onload 不加载 iframe jquery
在我的页面上我有 2 个 iframe。
我有一个在点击时重新加载 iframe 的功能。
现在我想加载主页而不加载 2 iframe。 这可能吗?我该怎么做?
<ul>
<li><a href="#discotheque">Discothèque</a>
</li>
<li><a href="#articlesPresse">Articles de presse</a></li>
</ul>
<div id="discotheque">
<a href="javascript: void(0)" onclick="discothequeReload();" style="text-decoration: none" class="">Nouvelle recherche</a>
<script type="text/javascript">
function discothequeReload () {
var f = document.getElementById('discothequeReload');
f.src = f.src;
}
</script>
<!--TEST RELOAD-->
<iframe id="discothequeReload" frameborder="0" src="http://www.google.com">
</iframe>
</div>
<div id="articlesPresse">
Articles de presse
<a href="javascript: void(0)" onclick="articlesPresseReload();" style="text-decoration: none" class="">Nouvelle recherche</a>
<script type="text/javascript">
function articlesPresseReload () {
var f = document.getElementById('articlesPresseReload');
f.src = f.src;
}
</script>
<!--TEST RELOAD-->
<iframe id="articlesPresseReload" frameborder="0" src="http://www.yahoo.com">
</iframe>
</div>
On my page i have 2 iframes.
I have a function to reload the iframe on click.
Now I would like to load the main page without loading the 2 iframe.
Is that possible? How would i do that?
<ul>
<li><a href="#discotheque">Discothèque</a>
</li>
<li><a href="#articlesPresse">Articles de presse</a></li>
</ul>
<div id="discotheque">
<a href="javascript: void(0)" onclick="discothequeReload();" style="text-decoration: none" class="">Nouvelle recherche</a>
<script type="text/javascript">
function discothequeReload () {
var f = document.getElementById('discothequeReload');
f.src = f.src;
}
</script>
<!--TEST RELOAD-->
<iframe id="discothequeReload" frameborder="0" src="http://www.google.com">
</iframe>
</div>
<div id="articlesPresse">
Articles de presse
<a href="javascript: void(0)" onclick="articlesPresseReload();" style="text-decoration: none" class="">Nouvelle recherche</a>
<script type="text/javascript">
function articlesPresseReload () {
var f = document.getElementById('articlesPresseReload');
f.src = f.src;
}
</script>
<!--TEST RELOAD-->
<iframe id="articlesPresseReload" frameborder="0" src="http://www.yahoo.com">
</iframe>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您说您想从您的页面重定向到 iframe 的位置...
If you are saying you would like to redirect from your page to the location of the iframe...
当用户点击您的链接时加载页面并加载 iframe?好的,当用户点击时放置 iframe html。我认为它有效...我记得我做了这样的东西
几个月前。
Load the page and load de iframes when the user click on your link? Ok, put the iframe html when the user click. I think that it work's... I remember I made something like this
a few months ago.