finding the error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WindAndWaves

    finding the error

    Hi Gurus

    First of all - I must tell you I am an absolute beginner.

    One of the problems I have with learning javascript is that I find it
    impossible to debug.

    I just use notepad to write the stuff and then when my IE gives me an error,
    the line (e.g. line 34) it mentions seems to be totally unrelated to the
    line which caused the error. My questions are twofold

    1. is that line in the IE error message of any help at all?

    2. does anyone has any recommendations for good javascript editors.

    TIA

    - Nicolaas


  • Fred Oz

    #2
    Re: finding the error

    WindAndWaves wrote:
    [color=blue]
    > One of the problems I have with learning javascript is that I find it
    > impossible to debug.
    >
    > I just use notepad to write the stuff and then when my IE gives me an error,
    > the line (e.g. line 34) it mentions seems to be totally unrelated to the
    > line which caused the error. My questions are twofold[/color]

    IE - yech! Notepad - tragic.

    Try using a decent editor - EditPlus is pretty good, it's shareware and
    cheap (I'm presuming you don't have any other development environment).
    Others here likely can suggest other/better alternatives.

    http://www.editplus.com/ or tucows.
    [color=blue]
    > 1. is that line in the IE error message of any help at all?[/color]

    Yes, but if the script is in a HTML page, the line number refers to the
    start of the script the error is in, not the entire HTML file. Sometimes
    the actual error is the line above or maybe many lines above... Also,
    often just the first error is useful since subsequent errors may be
    caused by the first one (e.g. leaving off a quote mark...).
    [color=blue]
    > 2. does anyone has any recommendations for good javascript editors.
    >[/color]

    See above. More importantly, use another browser - Firefox has very
    good support, the javascript console will even attempt to highlight the
    erroneous line of code (usually pretty reliably too). But beware, it
    has a couple of bugs. But test in IE too, and as many other browsers as
    you dare.

    Fred.

    Comment

    • Lee

      #3
      Re: finding the error

      WindAndWaves said:[color=blue]
      >
      >Hi Gurus
      >
      >First of all - I must tell you I am an absolute beginner.
      >
      >One of the problems I have with learning javascript is that I find it
      >impossible to debug.
      >
      >I just use notepad to write the stuff and then when my IE gives me an error,
      >the line (e.g. line 34) it mentions seems to be totally unrelated to the
      >line which caused the error. My questions are twofold
      >
      >1. is that line in the IE error message of any help at all?
      >
      >2. does anyone has any recommendations for good javascript editors.[/color]

      The editor you're using is fine.
      You need a better test environment than IE.
      Choose just about any other free browser.
      I recommend Firefox.

      Comment

      • WindAndWaves

        #4
        Re: finding the error


        "WindAndWav es" <access@ngaru.c om> wrote in message
        news:boK5d.6976 $JQ4.538053@new s.xtra.co.nz...[color=blue]
        > Hi Gurus
        >
        > First of all - I must tell you I am an absolute beginner.
        >
        > One of the problems I have with learning javascript is that I find it
        > impossible to debug.
        >
        > I just use notepad to write the stuff and then when my IE gives me an[/color]
        error,[color=blue]
        > the line (e.g. line 34) it mentions seems to be totally unrelated to the
        > line which caused the error. My questions are twofold
        >
        > 1. is that line in the IE error message of any help at all?
        >
        > 2. does anyone has any recommendations for good javascript editors.
        >
        > TIA
        >
        > - Nicolaas
        >
        >[/color]

        Thanks both for your answer. I will download firefox.

        Do you know of any editors that will check your javascript syntax and will
        give you allow autocomplete and that sort of stuff (so I will learn the
        syntax faster)?


        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: finding the error

          WindAndWaves wrote:
          [color=blue]
          > Do you know of any editors that will check your javascript syntax and will
          > give you allow autocomplete and that sort of stuff (so I will learn the
          > syntax faster)?[/color]

          IIRC Macromedia Dreamweaver (for Windows) provides an autocomplete feature.
          However, you should keep away from code generated by Dreamweaver (snippets
          and widgets).

          On GNU/Linux you should try Quanta Plus (requires KDE).

          However, on both OSes I prefer PHPeclipse for the Java-based eclipse IDE
          platform (but then I don't consider myself a beginner anymore.)

          But keep in mind that most of client-side J(ava)Scripting is UA dependent
          DOM scripting. Even more, whether a language feature is available or not
          depends on the UA and its script engine. It is likely that no editor
          provides sufficient built-in information about the available and
          unavailable features. Only study (of the specs, this group etc.) really
          helps.


          PointedEars

          Comment

          Working...