admin管理员组文章数量:1399947
I am checking out this link :
The page is a slideshow where the user can either press the Next/Previous button or use the right/left arrow keys to navigate through the slideshow. Everytime the user does a navigation, the ad unit on the right sidebar does a refresh. Any idea how this can be effected?
I am checking out this link : http://www.businessinsider./the-worlds-weirdest-etfs-that-you-can-trade-today-2011-10#market-vectors-gaming-etf-nyse-bjk-1
The page is a slideshow where the user can either press the Next/Previous button or use the right/left arrow keys to navigate through the slideshow. Everytime the user does a navigation, the ad unit on the right sidebar does a refresh. Any idea how this can be effected?
Share Improve this question asked Oct 10, 2011 at 16:34 Anand SAnand S 191 gold badge1 silver badge2 bronze badges1 Answer
Reset to default 3The advertisement is displayed in an iframe
(so it is not a simple div
, in which case you would have to reload content using Ajax).
In the event handler for the navigation buttons, you simply have to reload this iframe
.
You can either do this by using location.reload()
:
document.getElementById('myiframe').reload(true);
/*"true" means the URL should not be reloaded from cache*/
or setting the src
to its current value:
var myIframe=document.getElementById('myiframe');
myIframe.src=myIframe.src;
本文标签: javascriptHow to trigger refresh of a div unit on a page (Example given)Stack Overflow
版权声明:本文标题:javascript - How to trigger refresh of a div unit on a page (Example given) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744203352a2595072.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论