Click here to Skip to main content
15,120,078 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
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 ('http://92.62.182.23') does not match the recipient window's origin ('http://92.62.182.23:8585').

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

messagechanel doc : messagechanel


Thanks for Help
Posted

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.
SQL
just add he bellow line on top of  both page (within java script tag) means in parent page and child(iframe page).

document.domain = '92.62.182.23';
   

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