【发布时间】:2014-12-06 15:17:30
【问题描述】:
我想从其他 html 中获取 iframe 的属性 'src'。
我可以在同一个html中获取iframe的属性,但不能从其他html中获取,
看看我的代码:
/////////iframe attribute from the same html//////////
var Mframe_src = $("#Mframe").attr('src');
alert(Mframe_src);
//////////iframe attribute from other html////////////
var frame_Ads = $("#Mframe").contents();
var Ads_src = frame_Ads.find("#ads");
alert(Ads_src.attr('src')); /// the alert present me undefined
【问题讨论】:
-
“其他 html”是什么意思?
-
"other html"其他域??? -
iFrame 是否与主 HTML 来自同一域?
标签: javascript jquery html get