WEB this line is working in Firefox/Camino, not in Safari/IE (yes i Googled already)

Discussion in 'OT Technology' started by babygodzilla, Sep 17, 2007.

  1. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    ive got a script that works just fine in Camino / Firefox, but not in Safari / IE. seems like its failing on this line:

    Code:
    var eventId		= entry.getElementsByTagName("id")[0].textContent;
    the result of that line in Safari is "undefined." i tried textContent and innerText and data, after some Googling suggested me to try one or the other, but neither worked. :wtf: anyone know anything about this?
     
    Last edited: Sep 17, 2007
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    Have you tried this?

    Code:
    var eventId = entry.getElementsByTagNameNS("*", "id")[0].textContent;
     
  3. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    i found out the problem. i had a tag named <gd:where> and in firefox the namespace is not read, so u gotta do getElementsByNameTags("where") whereas in IE, the namespace IS read, so u do getElementsByNameTags("gd:where")
    :ugh: that is so gay. ive got so many ternary operations its fugly...

    kingtoad u mind looking at my script for another thing?

    the problem is after i fill the search box and IMMEDIATELY PRESS ENTER, for some reason the browser loads something at eventfulMap.html?artist=maroon, which is completely wrong. i have no clue how that got there. so i have to

    1) Press tab to move cursor to Search button
    2) Press enter
    3) Profit

    is there a way i can press enter without having to move the cursor to the Search button and get the correct results? i think it has something to do with me using a Button type instead of a Submit type. but when i use a Submit type i get this error instead

     
    Last edited: Sep 17, 2007
  4. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    Haven't really had a chance to look at your code. You are correct about the button thing though. If you just want to press enter, then you'll need to switch to Submit in order to post the form by pressing "enter". With type: button, you have to click. Perhaps it's another namespace issue.

    Also says the site is offline right now.
     
  5. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    i moved the script, thats why its offline :) but i did changed the button to submit and it worked! thanks!
     

Share This Page