1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<html> <head> <title>reply</title> <script> myObject.onmessage = function (event) { try { myObject.postMessage(event.data); } catch (e) { // ArrayBuffer may not supported, echo error back. myObject.postMessage(e.toString()); } }; myObject.postMessage("Hello"); </script> </head> <body> <div>post message waiting for reply</div> </body> </html>