Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 115991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:06:26+00:00 2026-05-11T03:06:26+00:00

I have a <div> that holds a google ad. My website is mostly AJAX

  • 0

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 isn’t 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 didn’t 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. 🙂

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.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:06:27+00:00Added an answer on May 11, 2026 at 3:06 am

    As both of the other answers state, refreshing your AdSense advertisements automatically isn’t allowed. I understand that you only intend to refresh the ad in response to user action, but it still isn’t allowed, even though it should be!

    Remember, the reason why you want to update the advertisements is so that you can show new ones. Displaying an advertisement is called an "impression." When you use code to refresh the ads, you are automatically generating ad impressions.

    AdSense Program Policies state (emphasis mine):

    Invalid Clicks and Impressions

    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, using robots, automated click and impression generating tools, third-party services that generate clicks or impressions such as paid-to-click, paid-to-surf, autosurf, and click-exchange programs, or any deceptive software.

    Refreshing your advertisements is a violation of the letter of the rule against generating impressions. With that said, I think any reasonable person would agree that refreshing advertisements in an AJAX app in response to user behavior (e.g. in response to a click) isn’t a violation of the spirit of the rule.

    For example, imagine rewriting your entire app to stop using AJAX. That’s clearly a worse experience for your users (it’s slower, the page flashes on every click, the page can’t dynamically update in the background), but, by a technicality, it’s not a violation of the AdSense Program Policies.

    Clearly Google meant to prohibit automatically replacing the advertisements every five seconds (creating a "slideshow" of advertisements). Google also meant to prohibit making your site look more attractive to advertisers by appearing to have more visits than you actually have. I’m sure they didn’t intend to prevent you from designing a high-performance AJAX website… but unfortunately sometimes rules have unintended consequences.

    Of course, as you originally pointed out, you CAN still refresh your advertisements if you embed them in an iframe and modify its location. (Here’s how to use iframes in an AJAX application to refresh AdSense.)

    You rejected iframes in your initial question, perhaps because you knew that using iframes would violate Google’s policies… but if you insist on breaking the rules, you might as well break them all the way! 😉

    Ultimately, I think you’ll find that generating impressions this way isn’t worth the risk: you’ll "refresh" the ads only to find that Google is just showing you the exact same ads as before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a parent div .photo_container that holds an img , and stretches to
Okay so I have a web view that holds the chat bar div from
I have a div that will serve as container to other element, I have
I have a <div id=comment_posting_holder> tag that holds a form with two elements: a
I have 30 or so a buttons followed by a div that holds the
I have a page with a div id=videoFrame that holds the video tag. The
I have a parent div, that holds three div's. They are basically columns. I
I have a page with a container div that holds three additional divs as
I have div.content that holds div.images which is left floated and next to it
I have a big absolute div that holds a smaller relative div. The smaller

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.