SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add Event Listener - not working in IE6

    Hello,

    I'm writing a custom script to collect attributes from links and concatenate them to pass as a string to another function. I'm using a readily-available 'addListener' function so the click event doesn't overwrite others on the page. All this seems to be working in all browsers except IE6, and I suspect it may have something to do with event bubbling. Can anyone see my errors and any other ways I could improve the script? The test page is here:

    http://www.maryvillecollege.edu/lab/...yticsTest.html

    Thanks!

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Error is line 60 according to the spectacular JavaScript-error-notification-dialog. Happy debugging!

  3. #3
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Line 60 is a closing curly brace. What error notification dialog are you talking about?

  4. #4
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    When you open the page in IE, double-click on the yellow "!" icon on the left in the status bar. It'll show you the largely unhelpful error message. The line number is not always accurate (my IE6 says it's line 30, 'Object expected'), the error is sometimes on the line before or a completely different line if there is more than one javascript file being used.

    Maybe it's one closing curly brace too many. Check there are the same number of opening ones as closing ones.

  5. #5
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, the debugger in IE is useless. I've been using Firebug for Firefox, which is much better. I did modify the script after reading some information about event targets at quirksmode.org, and it seems to be working in IE now. I'll explain what I changed, if anyone is interested.


Bookmarks

Posting Permissions

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