Results 1 to 5 of 5

Thread: any really (or kinda) good debuggers?

  1. #1
    Join Date
    May 2006
    Location
    New York City
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default any really (or kinda) good debuggers?

    Can somebody tell me what's wrong with this code and why ie keeps telling me there's an error in the syntax? Thanks, I appreciate it.

    HTML Code:
    <a href="javascript:void();" onClick="document.pic.src='q_armsout.jpg';"><img src="c_armsout.jpg"/></a>
    . . .

    HTML Code:
    <img src="q_bnw3.jpg" name="pic" style="border: #bb5500 outset 10px;" />
    @)~}~~~

  2. #2
    Join Date
    Jun 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    The error is due to using the void keyword in 'javascript:void()'.
    Replace the standard keyword in the function name and then execute it. It works fine for me.

    -P.Maheswari
    Syncfusion Software
    (www.syncfusion.com)

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Rubbish. "void" is not a keyword in Javascript; it's a simple function that looks like this:
    Code:
    function void(a) {
    }
    Used for nullifying return values where they could be unhelpful.

    Try this:
    Code:
    <a href="javascript:void(0);" onclick="document.images['pic'].src='q_armsout.jpg';"><img src="c_armsout.jpg" /></a>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    May 2006
    Location
    New York City
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it works! thanks.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Actually, I'm mistaken above: it would appear to be an operator.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •