1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
6 <script type=
"text/javascript">
8 XDCommsChild - Cross Domain Communication, Child Object.
10 Create this in the child window with the address of the xdomaincomms.html file on the same domain as the parent window
12 var XDCommsChild = function(xdomaincommsAddress
) {
13 this.xdomaincommsAddress
= xdomaincommsAddress
;
15 this.isIe
= isInternetExplorer();
18 // need hidden frame for communication. IE8 is supposed to support postMessage, but I can't get it to work properly
22 this.postBack = function(data
) {
24 // this method tested against IE6,7 & 8
25 window
.open(this.xdomaincommsAddress
+ '#data=' + data
, 'xdcomms'); // MUST use window.open. frame.src or frame.location both fail
27 // for everything else - tested against Firefox 3, Chrome, Safari
28 window
.opener
.postMessage(data
, '*'); // should really restrict the domain data can come from here
32 this.postBackAndCloseWindow = function(data
){
34 setTimeout("window.close()", 200); // need to use a timeout to make sure the javascript in the frame has executed if we are using that communication model
40 <h3> This file should be inclued by external sites that want to be proxied:
</h3>