这适用于除 IE9 之外的所有浏览器,getAttribute 在 IE9 上返回 null,任何想法
function getFlashMovieObject(movieName){
if(document.embeds[movieName])
return document.embeds[movieName];
if(window.document[movieName])
return window.document[movieName];
if(window[movieName])
return window[movieName];
if(document[movieName])
return document[movieName];
}
function ChangePlaylist(newval,mymovievarmp3){
var mp3Player = getFlashMovieObject(mymovievarmp3);
var newstring = mp3Player.getAttribute('data');
var broken = new Array();
broken = newstring.split('?');
mp3Player.setAttribute('data',broken[0]+'?'+broken[1]+'?'+newval)
}
使用 JQuery 但仍然无法正常工作
var mp3Player = getFlashMovieObject(mymovievarmp3);
var newstring = $("#mp3Player ").data("data");