View Full Version : I have got the script of cross domain communication i want ur help

01-09-2009, 12:46 PM
hello ,


in this script they have included 2 iframes. parent can send a message to both iframes and frames can send massage to each other.

they have called the function at particular event . I don't want to call the function at particular event.(they have sent the message at button (sentbtn) click event) .

in My example i have 2 or more text box these are generated dynamically . and when user will write some thing in text box, will press the enter button that time i want to call the javascript function that is present in another iframe (domain is different).....

code is really complicated to understand .......

note: iframe domain is not same
text box id is not same. id is generated dynamically.

help me out to solve this ....

01-09-2009, 01:18 PM
I may have a closer look at this later. But for now - be aware:

It doesn't work in Opera, perhaps others.

For two way communication (perhaps even for just one way), it requires that you have access to all of the pages on all of the domains and to the domains themselves. You must include the scripts on all of the pages.

There are server and client side restrictions that can block this.

See also (from the author's blog):



There is a danger associated with this kind of “hack”. First of all, browser vendors may decide to change their security policies and mimic Opera’s behavior for example. If this happens, CrossFrame will stop working for those browsers. Furthermore, I do not recommend using hacks because they slow down the rate of innovation on the web (it makes the task of developing web browsers even more complicated than it already is, and also makes your application less maintainable) Therefore, as paradoxical as it may seem, I do not recommend using CrossFrame (or any of those ugly hacks for that matter)