Arggg... Javascript call to place adsense code

Discussion in 'HTML & Website Design' started by jeremyweber, Aug 29, 2006.

  1. #1
    Any help would be appreciated.

    What I am trying to do it rotate an adsense block in 1 of 3 table cells. Everything works great in FireFox 1.5 but it doesnt work in IE or lower versions of Firefox.

    I am using the time to rotate the ad. If <=3 appear in cell1, <=6 cell 2, etc. Basically in Firefox < 1.5 and IE the adsense block appears outside of the table.

    If anyone has suggestions I'd appreciate it.

    You can check out the code here...

    http://www.hair-band.com/test/js/hb.html

    Thanks
     
    jeremyweber, Aug 29, 2006 IP
  2. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #2
    Interesting approach. I think you could better use Math.random() for random numbers generation. Example here.
     
    wmtips, Aug 29, 2006 IP
  3. jeremyweber

    jeremyweber Peon

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Any ideas why the ad block appears outside the table in IE/FF<1.5? Thats the real question. .. Also, I dont see any real reason to use math.random, why do you think I would need to?
     
    jeremyweber, Aug 29, 2006 IP
  4. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #4
    You have many errors in your html.

    HTML Tidy in my firefox shows:

    1. line 9 column 1 - Warning: <script> isn't allowed in <tr> elements
    2. line 14 column 57 ... many many - Warning: '<' + '/' + letter not allowed here (you must escape slash in JS)
    3. line 56 column 1 - Warning: missing <td>

    About math.random() - I think it's more elegant solution than var c = minutes.charAt(minutes.length-1);
     
    wmtips, Aug 29, 2006 IP
  5. jeremyweber

    jeremyweber Peon

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What version of firefox are you running and is the html tidy a plugin or are you running it externally. Thanks for the help.
     
    jeremyweber, Aug 30, 2006 IP
  6. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #6
    wmtips, Aug 30, 2006 IP