Html iframe中的内容重定向,但不重定向整个页面
我有一个专栏,里面有这样的代码:Html iframe中的内容重定向,但不重定向整个页面,html,css,Html,Css,我有一个专栏,里面有这样的代码: <div class="cat"> <iframe src="sidebar.html" frameborder="0" ></iframe> </div> 这是“sidebar.html”中的一行: 示例 (请记住,这是表的一部分) 当我点击单词“example”时,它实际上会重定向到应该重定向到的位置,但这只在iframe内部可见 我想将整个页面重定向到www.example.com只需在windo
<div class="cat">
<iframe src="sidebar.html" frameborder="0" ></iframe>
</div>
这是“sidebar.html”中的一行:
示例
(请记住,这是表的一部分)
当我点击单词“example”时,它实际上会重定向到应该重定向到的位置,但这只在iframe内部可见
我想将整个页面重定向到www.example.com只需在window.location之前添加“parent.”
<th target="_top" onclick="parent.window.location='http://example.com'">example</th>
示例
您可以使用
window.top.location.href=”http://www.newurl.com";代码>
更改父页面的URL
一个简单的重定向只能在iframe内部工作
<th target="_top" onclick="parent.window.location='http://example.com'">example</th>