我正在通过同一个域,为用户提供在页面上的iframe内导航的功能。我想在Chrome中处理iframe的onload并处理用户导航到的实际href。当我试图访问时Chrome iframe的location.href未定义
document.getElementById("contentFrame").contentWindow.location.href
它表示undefined
。调试器告诉location
是一个对象,但我找不出要使用的属性。
任何猜测? Chrome v15
优秀的捕获。我的端口不同,这不是IE中的跨域问题。最终Chrome似乎认为不同 –