Click here to Skip to main content
15,116,815 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use messageChanel for trancfer data between parent page and an iframe !
my parent page addres is : localhost:80
and my iframe addres is : localhost:8585
But I give this Error !
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('') does not match the recipient window's origin ('').

So ! How i can trancfer between two port ?? did U know any way ?

messagechanel doc : messagechanel

Thanks for Help

The targetOrigin should specify the domain to which message is posted while posting the message and domain from which it is coming in recipient event.
just add he bellow line on top of  both page (within java script tag) means in parent page and child(iframe page).

document.domain = '';

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900