hello i have now a div i want it reload without reloading the page in 15000 miliseconds so there will be showed new ad for the user,
<div id=GoogleAd>
<script>
GOOGLE_ADS_CODE
</script>
</div>
hello i have now a div i want it reload without reloading the page in 15000 miliseconds so there will be showed new ad for the user,
<div id=GoogleAd>
<script>
GOOGLE_ADS_CODE
</script>
</div>
Just so you know, doing this is not allowed and might result in banning your account. You can read this article for more information: https://support.google.com/adsense/answer/48182?hl=en
Here is a quote from there:
Invalid clicks and impressions
Publishers may not click their own ads or use any means to inflate impressions and/or clicks artificially, including manual methods.
Clicks on Google ads must result from genuine user interest. Any method that artificially generates clicks or impressions on your Google ads is strictly prohibited. These prohibited methods include, but are not limited to, repeated manual clicks or impressions, automated click and impression generating tools and the use of robots or deceptive software. Please note that clicking your own ads for any reason is prohibited.
So you can use AJAX to refresh this section only, but do this at your own risk.
Use Ajax for this.
Build a function that will fetch the current page via ajax, but not the whole page, just the div in question from the server. The data will then (again via jQuery) be put inside the same div in question and replace old content with new one.
Relevant function:
eg
$('#thisdiv').load(document.URL + '#thisdiv');
Note, load automatically replaces content.
Credit goes to this guy