I have this code:
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='800' height='470' id='Gen5Core' align='middle'><param name='allowScriptAccess' value='always'/><param name='allowFullScreen' value='true'/><param name='movie' value='http://h71016.www7.hp.com/html/interactive/_core/Gen5Core.swf?corePath=http://h71016.www7.hp.com/html/interactive/_core/&serverName=http://h71016.www7.hp.com/html/interactive/p1102w/'/><param name='quality' value='high'/><param name='bgcolor' value='#333333'/><embed src='http://h71016.www7.hp.com/html/interactive/_core/Gen5Core.swf?corePath=http://h71016.www7.hp.com/html/interactive/_core/&serverName=http://h71016.www7.hp.com/html/interactive/p1102w/' quality='high' bgcolor='#333333' width='800' height='470' name='Gen5Core' align='middle' allowScriptAccess='always' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object>
It works great if I put it directly on the page.
But I want to enable it on the fly in a popup, so I wrote this function:
<script type="text/javascript"> $(document).ready(function () { $('.newWindow').click(function (event) { var termWin = window.open('', '', 'width=600,location=0,toolbar=0,resizable=1,height=400,menubar=0,scrollbars=1'); termWin.document.write('<html><head><title>TITLE</title><body><div> <object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' codebase=\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\' width=\'800\' height=\'470\' id=\'Gen5Core\' align=\'middle\'><param name=\'allowScriptAccess\' value=\'always\'/><param name=\'allowFullScreen\' value=\'true\'/><param name=\'movie\' value=\'http://h71016.www7.hp.com/html/interactive/_core/Gen5Core.swf?corePath=http://h71016.www7.hp.com/html/interactive/_core/&serverName=http://h71016.www7.hp.com/html/interactive/p1102w/\'/><param name=\'quality\' value=\'high\'/><param name=\'bgcolor\' value=\'#333333\'/><embed src=\'http://h71016.www7.hp.com/html/interactive/_core/Gen5Core.swf?corePath=http://h71016.www7.hp.com/html/interactive/_core/&serverName=http://h71016.www7.hp.com/html/interactive/p1102w/\' quality=\'high\' bgcolor=\'#333333\' width=\'800\' height=\'470\' name=\'Gen5Core\' align=\'middle\' allowScriptAccess=\'always\' allowFullScreen=\'true\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object> </div></body></html>'); termWin.document.close(); termWin.focus(); }); }); </script>
which will be opened when the user clicks on the link with the newWindow class.
<a href="#" class="newWindow"> <img src="@Url.Content("~/Content/Images/icon_demo_black.gif")" /> </a>
I have one problem:
- in Chrome, the popup is empty, so the embedded object does not work (but I see how to verify that the code was successfully placed in the html source).
Can you give a helping hand?
source share