开发者

Flash content replacing with javascript document.getElemendByID("id").innerHTML

I have a webpage, on which I am using Ajax to replace different divs of my page against some click events.. All works fine for regular HTML... but when I want to add a SWF object tag through function

document.getElementByID("div-id").innerHTML = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000> .... All flash movie code ... </object>";

My browser shows nothing.. and no error is generated also... I am a开发者_C百科ssuming that it should show the Flash movie.. I have checked it in IE 8.0, FireFox, Chrome.. none of them is working.. I have monitored the div using firebug, it is showing that div is being replaced by the Flash player code, but then why it is not being displayed in that div?


The problem may be hidden in the All flash movie code part... :P Flash embedding is tricky, there is many different way to embed it leading to different result. That's why ppl use libraries instead of writing plain html/js.

The most popular and standard way to embed Flash is to use swfObject. Or you use jQuery, there is flashembed from jQuery Tools.

Both of them works in all major browsers, able to handle things like flashVars, embed params etc.


Missing a quote in the class id attribute?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜