我有一个这样的网页...访问的iFrame网址与jQuery/JavaScript的
<div>
<iframe id="mainContent">
<iframe id="littleBox">
</div>
,我想做到这一点...
$(".someButton").live('click', function() {
alert(/*The URL That the Main Frame is ON*/);
});
我发现这一点:$("#mainFrame").get(0).location.href
,但它不工作...
另外,我需要它返回当前的网址,所以如果有人浏览它应该返回它们所在的当前页面。
这里同样的问题问:http://stackoverflow.com/questions/44359/how-do-i-get-the-current-location-of-an-iframe – epascarello 2010-09-14 04:42:07