2

easyXDM は優れたメッセージ トランスポート システムを備えているように見えます。GIT ドキュメントのブリッジの例は、3 つまたは 4 つの HTML ファイルを含む非常に複雑です。同じドメイン上の子ウィンドウと親ウィンドウを使用して、IE8 互換性などを使用して、単純なウィンドウ間通信を行うことはできますか?

easyXDM の専門家の助けが必要 - (このコードは動作しません)

<! doctype html>
<html>
 <head>
       <!-- index.html -->
   <title>postmessage Test</title>
       <script type="text/javascript" src="easyXDM.debug.js"                                                           </
script>
       <script type="text/javascript">
easyXDM.DomHelper.requiresJSON("json2.js");             </script>

   <script type="text/javascript">
       var target;

       target = window.open("http://localhost/child.html",'popupWindow');

       var socket = new easyXDM.Socket({
               swf: "easyxdm.swf",
               onMessage: function(message, origin){
                       alert("Received '" + message + "' from '" + origin + "'");
               }
       });
       </script>

 </head>
 <body>
       Parent Window<br/>
   <button class="send-button" onclick="socket.postMessage('Msg from
Parent');">Post message</button>

 </body>
</html>

<! doctype html>
<html>
 <head>
       <!-- child.html -->
   <title>postmessage Child</title>
       <script type="text/javascript" src="easyXDM.debug.js"                                                           </
script>
       <script type="text/javascript">
easyXDM.DomHelper.requiresJSON("json2.js");             </script>

   <script type="text/javascript">

       var socket = new easyXDM.Socket({
               remote: "http://localhost/",
               swf: "easyxdm.swf",
               onMessage: function(message, origin){
                       alert("Received '" + message + "' from '" + origin + "'");
               }
       });
       </script>

 </head>
 <body>
   Popup Window<br/>
   <button class="send-button" onclick="socket.postMessage('Msg from
child');">Post message</button>

 </body>
</html>
4

0 に答える 0