【发布时间】:2013-01-19 16:03:52
【问题描述】:
我正在尝试更改父 iframe 中以下 div 中的文本。
(我在 iframe 中运行代码)
<div class="hello1">I want to change this</div>
我怎么能做到这一点?
我试过了:
$("body #hello1", top.document).text("HELLO");
但我得到这个错误:
不安全的 JavaScript 尝试访问框架
有什么想法吗?
【问题讨论】:
-
你在 'document' 中留下了最后一个 't'
-
已编辑,是我的问题中的错字:) 仍然是同样的错误
-
如果知道要寻址的帧号,可以使用
parent.frames[#]
标签: jquery