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 2 of 2
  1. #1
    Regular Coder zro@rtv's Avatar
    Join Date
    Feb 2005
    Location
    on the network
    Posts
    433
    Thanks
    0
    Thanked 1 Time in 1 Post

    Adding onclick via DOM (IE)

    I know this is greatly discussed, and perhaps i am simply overlooking the answer in post elsewhere. I apologize if this is the case.

    here is a page where this javascript is supposed to be taking effect.

    Everything is fine in FF, as per usual.
    In IE, though I get no effect, and the error states:
    Code:
    Line:9
    Char:5
    Error:Object doesn't support this property or method
    Code:0
    URL:http://ec3kids.org/staff
    I find this confusing as it does not even seem to point to the JS, and even if I assume it means that JS file linked above, that line/column number seems irrelevant, not to mention, I thought I had enough error checking in place that errors shouldn't occur.

    On an even stranger note, when I try any of this locally, half of the functionality works. Namely the "additional link" is appended, and the "style:cursor;" attribute is applied. None of that even works when accessed on the server.

    I have tried using "setAttribute()", and "element.onclick=" with both an anonymous function and also simply the window.location as the value.

    wtf am i supposed to be doing here?
    Thanks for any time and effort put into this!
    ._-zro
    zro@redtv
    zro.redtv.org

    "If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"
    -Tim Berners-Lee, Weaving the Web, 1999

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    IE does not support hasAttribute

    This line is giving the error:
    Code:
    if (!quotes[i].hasAttribute("cite")) continue;


  •  

    Posting Permissions

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