C
chaitatp
Hi friends,
I've got a problem about inserting Flash in iframe in Firefox. The
codes are:
---- test.html ----
<html>
<head>
<script type="text/javascript">
function doBodyOnLoad()
{
var myIFrame = document.getElementById('myIFrame');
myIFrame.contentWindow.document.designMode = 'on';
}
function doPaste()
{
var myIFrame = document.getElementById('myIFrame');
var currentSelection = myIFrame.contentWindow.getSelection();
var currentRange = currentSelection.getRangeAt(0);
// var html = "<b>hello world</b>";
// var html = '<img
src="http://mail.google.com/mail/help/images/logo.gif"/>';
var html = '<EMBED src="http://thaiunix/~chaitat/GOT/MacOS.swf"
quality="high" menu="true"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="114" height="76"></EMBED>';
if (html != null)
{
// Assume Firefox
currentRange.insertNode(currentRange.createContextualFragment(html));
}
}
</script>
</head>
<body onLoad="doBodyOnLoad();">
<input type="button" onClick="doPaste();"/>
<iframe id="myIFrame" src="test2.html" width="100%"
height="50%"></iframe>
</body>
</html>
---- test2.html ----
<html>
<body>
</body>
</html>
When I click the button, the Flash is inserted but doesn't display. I
need help. Thank you very much.
Y_Y
I've got a problem about inserting Flash in iframe in Firefox. The
codes are:
---- test.html ----
<html>
<head>
<script type="text/javascript">
function doBodyOnLoad()
{
var myIFrame = document.getElementById('myIFrame');
myIFrame.contentWindow.document.designMode = 'on';
}
function doPaste()
{
var myIFrame = document.getElementById('myIFrame');
var currentSelection = myIFrame.contentWindow.getSelection();
var currentRange = currentSelection.getRangeAt(0);
// var html = "<b>hello world</b>";
// var html = '<img
src="http://mail.google.com/mail/help/images/logo.gif"/>';
var html = '<EMBED src="http://thaiunix/~chaitat/GOT/MacOS.swf"
quality="high" menu="true"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="114" height="76"></EMBED>';
if (html != null)
{
// Assume Firefox
currentRange.insertNode(currentRange.createContextualFragment(html));
}
}
</script>
</head>
<body onLoad="doBodyOnLoad();">
<input type="button" onClick="doPaste();"/>
<iframe id="myIFrame" src="test2.html" width="100%"
height="50%"></iframe>
</body>
</html>
---- test2.html ----
<html>
<body>
</body>
</html>
When I click the button, the Flash is inserted but doesn't display. I
need help. Thank you very much.
Y_Y