Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript">
- function fromJs()
- {
- alert("hello from JavaScript");
- return "text from js";
- }
- </script>
- </head>
- <body>
- <div id="testdiv">loading...</div>
- <script type="text/javascript">
- var s;
- 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">';
- s += '<PARAM NAME="Src" VALUE="ajax.swf"><PARAM NAME="AllowScriptAccess" VALUE="always">';
- 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">';
- s += '</embed></OBJECT>';
- // Works in IE and FF
- document.getElementById("testdiv").innerHTML = s;
- // ExternalInterface.call calls JS but does not return value in IE. Works in FF
- var tempDiv = document.createElement("div");
- tempDiv.innerHTML = s;
- document.body.appendChild(tempDiv);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement