js调用flash需要注意地方

获取flash对象的方法。

在网上查找的很多js获取flash对象的方法,不兼容IE9,这里提供一个能兼容IE9的方法。同时兼容其它浏览器。

function thisMovie(movieName) {
if (navigator.appName.indexOf(“Microsoft”) != -1) {
//alert(“IE”);
if (typeof (window[movieName].qqBuyUpdate) == ‘function’) {
// < IE9
return  window[movieName];
}
else if (typeof (document[movieName].qqBuyUpdate) == ‘function’) {
// >= IE9
return  document[movieName];
}
}
else {
// NON IE
return  document[movieName];
}
}

 

在js里面调用flash:

thisMovie(“client”).qqBuyUpdate();

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>