【发布时间】:2013-06-17 07:21:40
【问题描述】:
我想访问父 jQuery 上的 iframe 内容。
我在父页面上添加了以下代码。
$(document).ready(function () {
$('#MyIframe').load(function () {
$('#MyIframe').contents().find('body').html('Hey, i`ve changed content of <body>! Yay!!!');
});
});
我的 iframe 页面从其他网站加载它给我一个错误
Error: Permission denied to access property 'ownerDocument'
[Break On This Error]
...f ( ( context ? context.ownerDocument || context : preferredDoc ) !== document )...
【问题讨论】:
-
而且 iFrame 当然是显示来自同一个域的内容?
标签: javascript jquery asp.net iframe