【发布时间】:2014-09-25 23:51:49
【问题描述】:
我想防止 iframe 被重定向到当前加载在其中的同一地址。我想这样做的原因是,当您被重定向到完全相同的页面时,我想防止不必要的白色闪烁。
这是一个 jsfiddle http://jsfiddle.net/8zs8mh5d/
<a href="http://www.randomwebsite.com/" target="tc">dont redirect if not from link 3</a><br>
<a href="http://www.randomwebsite.com/" target="tc">dont redirect if not from link 3</a><br>
<a href="http://day.smakkie.com/" target="tc">dont redirect if not from link 1 or 2</a><br>
<iframe id="truecontent" name="tc" src="http://www.randomwebsite.com/"></iframe>
#truecontent
{
height:200px;
width:400px;
}
【问题讨论】:
标签: javascript html redirect if-statement iframe