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;