【发布时间】:2011-05-22 06:53:31
【问题描述】:
如何防止 IE 更新页面?我希望它表现得像 FF、SF 和 C。因为它是同一个页面,所以它不应该上传...
父页面:
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<p>This is the parent page. I don't want this page to reload in IE when the link in the iframe is clicked, since it break our javascript. I only want the "hash" to change.</p>
<iframe src="http://example.com/iframepage.html"></iframe>
</body>
</html>
iframe 页面:
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<p>This is the iframe page. The URL is the same as the parent page + anchorlink. When I klick this link in IE the page refresch and the javascript breaks. In FF, SF & C it doesn’t "refresh" page…</p>
<a href="http://www.example.com/test.html#test1" target="_top">test1</a>
</body>
</html>
【问题讨论】:
-
糟糕。我发帖时 HTML 消失了。父页面的 URL:example.com/test.html iframe 中的链接:a href="example.com/test.html#test1" target="_top">test1
标签: internet-explorer iframe hash refresh