Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Location
    North Canton, Ohio
    Posts
    118
    Thanks
    11
    Thanked 4 Times in 4 Posts

    Google adsense does not display in tables with firefox...

    I went to Google AdSense for groups for help (that was a mistake, it's like none of them even know css...) and I received no help at all.

    My problem is when I go to http://blahertech.dnsalias.net/_dev/ my google adsense does not display with firefox. I get the following error in my error console:
    Code:
    Error: uncaught exception: [Exception... "Object cannot be created in this context"  code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)"  location: "http://pagead2.googlesyndication.com/pagead/show_ads.js Line: 4"]
    I checked out the show_ads script, no thanks to any line breaks or spacing in Google's coding, and found some of the code in that line checked for what the tag that was holding the Google adsense script. I'm currently using tables, and the way my layout is made, I can't use anything else without rewriting the whole page. It checked for, div, span, iframe, and other tags, but no table tag. I'm guessing that's what the error meant.

    I tired tricking it, and putting div and then span tags in side the table surrounding the adsense script, but it still comes up as the same error...

    If anyone has any idea how to fix this without losing the tables, I'd be very happy for your help. -Thank You

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Google adsense I believe uses document.write for their script meaning it can't be used when the application/xhtml+xml header is passed to the browser.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Location
    North Canton, Ohio
    Posts
    118
    Thanks
    11
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    Google adsense I believe uses document.write for their script meaning it can't be used when the application/xhtml+xml header is passed to the browser.
    Maybe I could make a separate html file containing the ad script, and then have the page frame it (or maybe even make it a object? but I don't know if that will work?). But I don't know how that will affect the content for the ads to draw from? Would it still draw it from the page it's being framed, or would it pull the content from the page the script is on only?
    I guess I could put some content in that script page, maybe if I put the content keywords in the meta tags would it pull it from that?
    Last edited by Blaher; 06-10-2007 at 09:35 PM. Reason: ing

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    That might work but do you have to use the application/xhtml+xml header? This part of your code is actually putting IE6 into quirks mode causing it render some things improperly.

    Code:
    <?xml version="1.0" encoding="iso-8859-1" ?>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Regular Coder
    Join Date
    Nov 2005
    Location
    North Canton, Ohio
    Posts
    118
    Thanks
    11
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    That might work but do you have to use the application/xhtml+xml header? This part of your code is actually putting IE6 into quirks mode causing it render some things improperly.

    Code:
    <?xml version="1.0" encoding="iso-8859-1" ?>
    Don't worry about that, if you did try going there in IE, it would have come up as html. Trust me, I a huge support for this site.
    I've coded my php to support almost any web browser, so for IE users it will come up as html until IE one day adds a http accept header with application/xhtml+xml in it, not like they'll ever even add an accept header.

    I'm very good with making my code flawless in browser diversity, it's just a few bugs here and there that drive me nuts that I can't handle them. I'll try my frame adsense idea, and if it doesn't work I'll come back here for help.

    In the mean time, why don't you check out my source for the site. You might get some new ideas on how to fix being so worried up about the introduction of xml into the new internet world.
    http://blahertech.dnsalias.net/projects/www/3/
    I'm about to upgrade the code soon, so make sure you download it sometime after Tuesday, I'll be done with the new adsense if I get it fixed.

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Google ads are intended for use with HTML and cannot be used with XHTML. The JavaScript uses document.write statements to add an iframe to the web page.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •