1

I am checking out this link : http://www.businessinsider.com/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?

4

1 回答 1

3

广告显示在一个iframe(所以它不是一个简单的div,在这种情况下你将不得不使用 Ajax 重新加载内容)。

在导航按钮的事件处理程序中,您只需重新加载 this iframe

您可以使用以下方法执行此操作location.reload()

document.getElementById('myiframe').reload(true);
/*"true" means the URL should not be reloaded from cache*/

或将src其设置为当前值:

var myIframe=document.getElementById('myiframe');
myIframe.src=myIframe.src;
于 2011-10-10T16:54:27.223 回答