Debugging javascript for Netscape

Results 1 to 2 of 2

Thread: Debugging javascript for Netscape

  1. #1
    Join Date
    Dec 1969

    Default Debugging javascript for Netscape

    Hi guys!<BR><BR>I have a script that works fine in IE6 but not NS7 and I am trying to debug it using their built-in JavaScript debugger, which I am new to.<BR><BR>There is an error: "targetID is not defined" on the first line of a function called showMenu(targetID).<BR>The line reads: var targetMenu = document.getElementById(targetID)<BR><BR>My problem is that I am sure targetID is defined, at least it is in IE6.<BR><BR>The targetID variable is passed to the function from the page element that invoked the function in the first place:<BR><BR>&#060;a href="bla.html" onmouseover="showMenu(&#039;devMenu&#039;)"&#062;B la&#060;/a&#062;<BR><BR>The string "devMenu" is the id attribute of another page element.<BR>Why does NS claim that my variable is undefined, when I sent it&#039;s value to the function in this way?<BR><BR>I&#039;d really appreciate some help with this!

  2. #2
    Join Date
    Dec 1969

    Default So did you try...

    ...simply doing<BR> alert("targetID is " + targetID);<BR>as the first line of that "showMenu" function?<BR><BR>And is it possible that it&#039;s not really complaining about the *variable* targetID but rather its contents? (That is, it can&#039;t find an element with the ID &#039;devMenu&#039;.) NS does *not* allow ID= in some HTML elements whereas MSIE allows ID= in virtually everything.<BR><BR>What kind of HTML element did you give that ID to?<BR><BR>

Posting Permissions

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