Advertisement
Guest User

huo

a guest
Sep 7th, 2009
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.  
  3. <head>
  4.  
  5. <script type="text/javascript">
  6.  
  7. function fromJs()
  8. {
  9.     alert("hello from JavaScript");
  10.     return "text from js";
  11. }
  12.  
  13. </script>
  14.  
  15. </head>
  16.  
  17. <body>
  18.  
  19. <div id="testdiv">loading...</div>
  20.  
  21. <script type="text/javascript">
  22.  
  23.  
  24.     var s;
  25.  
  26.     s = '<OBJECT id="testId" codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=550 height=400><PARAM NAME="Movie" VALUE="ajax.swf">';
  27.     s += '<PARAM NAME="Src" VALUE="ajax.swf"><PARAM NAME="AllowScriptAccess" VALUE="always">';
  28.     s += '<embed src="ajax.swf" width="550" height="400" name="testId" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';  
  29.     s += '</embed></OBJECT>';
  30.  
  31.     // Works in IE and FF
  32.     document.getElementById("testdiv").innerHTML = s;
  33.  
  34.     // ExternalInterface.call calls JS but does not return value in IE. Works in FF
  35.     var tempDiv = document.createElement("div");   
  36.     tempDiv.innerHTML = s;
  37.     document.body.appendChild(tempDiv);
  38.  
  39. </script>
  40.  
  41.  
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement