本文介绍了SetVariable在Firefox中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经用Flash Player实现了一个网页。然后我使用 SetVariable
关键字给出一个flash player对象的参数。
document.getElementById('flashPlayer')。SetVariable(player.jsUrl,www.my.com/Songs/ a.mp3\" );
在IE和Chrome浏览器中,Firefox除外。哪个关键字在Firefox中关注?
PS错误是错误调用方法在NPObject!。
嵌入元素上使用这个函数,而不是
对象
元素。 HTML
< object id = FLASHPLAYER>
< embed id =flashPlayerEmbed>
< / object>
Javascript
var player = document.getElementById('flashPlayer');
$ b $ if(typeof(player.SetVariable)=='undefined'){
player = document.getElementById('flashPlayerEmbed');
}
player.SetVariable(plyaer.jsUrl,www.my.com/Songs/a.mp3);
I have implemented a web page with Flash Player. And then I have used SetVariable
keyword to give a param for a flash player object.
document.getElementById('flashPlayer').SetVariable("player.jsUrl","www.my.com/Songs/a.mp3");
It is working finely in IE and Chrome except Firefox. Which keyword is working concern it in Firefox?
P.S The error is "Error calling method on NPObject!".
解决方案
Firefox can only use this function on the embed
element, not the object
element.
HTML
<object id="flashPlayer">
<embed id="flashPlayerEmbed">
</object>
Javascript
var player = document.getElementById('flashPlayer');
if(typeof(player.SetVariable) == 'undefined') {
player = document.getElementById('flashPlayerEmbed');
}
player.SetVariable("plyaer.jsUrl", "www.my.com/Songs/a.mp3");
这篇关于SetVariable在Firefox中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
08-18 22:54