Refresh a Div that has a Google ad inside it

Posted by Abs on Stack Overflow See other posts from Stack Overflow or by Abs
Published on 2009-01-12T13:27:28Z Indexed on 2010/05/07 1:58 UTC
Read the original article Hit count: 343

Filed under:
|
|
|
|

Hello all,

I have a div that holds a google ad. My website is mostly AJAX and there is no need for a browser refresh. That means my ads will not refresh either, which isnt ideal, a user staring at one ad all day.

So I wanted a way to refresh a particular div on a page. I found many solutions but they didnt work. For example, using JQuery's html function:

$("#ads").html("google ad script here");

This managed to refresh the whole page no idea how. I can also make an AJAX request to a HTML page that contains the google ad but I am guessing it will have the same effect as the above attempt.

I do not want to use iFrames.

Is there any other option open to me? My pea brain can not think of anymore. :)

Thanks you for any help.

EDIT:

It is allowed since I will be initiating the refresh only when a user clicks a link.

A prime example is Yahoo Mail - their new AJAX mailbox uses this same method, when a user clicks a link then a new ad is shown.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about div