Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

All that is output on the page is the domain name of the advertiser, for example 'www.solar-aid.org'. The rest of the content is stripped, I believe because of a document.write() statement.

I'd like to know if this is a common issue or something wrong with our setup. There are three domains causing the issue, which we've blocked from Adsense as a result.

  • solar-aid.org
  • kiva.org
  • grameenfoundation.org

Given the type of organizations I think they may be within the default group of 'public service ads' within the Backup Ads setting. If the issue doesn't completely resolve itself soon (one customer of ours complained today, even though I blocked them 5+ days ago), I'll disable public service ads and select the 'fill space with a solid color' option.

share|improve this question

1 Answer 1

In JavaScript, document.write() simply prints out text. I am pretty sure that it wouldn't strip the page of HTML unless it were missing a quote, in which case it would strip everything until the next quote appeared in the page.

If you could post some code of one of those domains, it would be a lot more helpful. Just like in HTML, JavaScript needs everything to be closed in the proper place in order to function correctly. However, usually the browser will see the syntax error, and simply stop executing all JavaScript on the page.

Knowing how your webpage is built too would help, if it has major PHP elements, or it's plain HTML or HTML with CSS/JavaScript.

I'm going to assume that you're using HTML with CSS/JavaScript for your webpage, and that the ad is at the top of the page or the first thing in the HTML body. A possible fix would be to sift through the code and look for syntax errors.

share|improve this answer
1  
Calling document.write() after the page has finished loading will remove all existing markup from the page, as if you'd called document.open(). Yeah, it seems stupid to me too. No, I don't know why it was designed like that. –  Ilmari Karonen Jan 18 '12 at 1:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.