如何获取flashvars
属性的值?
<div>
<embed height="360"
src="//www.youtube.com/get_player?enablejsapi=1"
type="application/x-shockwave-flash"
width="100%"
allowfullscreen="true"
allowscriptaccess="always"
bgcolor="#fff"
scale="noScale"
wmode="opaque"
flashvars="fmt_list=34%2F640x336%2F9%2F0%2F115%2C5%2F426x224%2F7%2F0%2F0&fmt_stream_map=34%7Chttp%3A%2F%2Fredirector.googlevideo.com%2Fvideoplayback%3Fid%3Da067d9378dddd818%26itag%3D34%26source%3Dpicasa%26cmo%....">
</embed>
</div>
我正在使用getElementsByTagName
来获取元素
var codedLink = content.document.getElementsByTagName('embed');
但是当我尝试codedLink.flashvars
时,我得到了未定义。
答案 0 :(得分:2)
答案 1 :(得分:0)
您可以使用.attr("/* attribute name */")
$(document).ready( function() {
console.log($('embed').attr('flashvars'));
});