purple oar software

"Ensuring Your Web Presence Contributes"

Javascript errors, line numbers from IE

admin's picture

Recently I received an email from Gary who tried out my shareware Javscript editor, ScrypTik. I tried to reply directly, but his email bounced. Gary's question was a good one, so I'll answer it here as it may help others.

Question:

I have downloaded a copy of ScrypTik and I like what it can offer. However, I have the following issue which is typical of my application:

I have a PHP file which refers to numerous js files

e.g.
When running the PHP, The IE browser (v7) will refer to a line number "line 706: character 3" which bears no relation to my PHP source file. It seems to be erroring on some Javascript at run-time. I know this is a run-time error since it occurs in specific situations.

What is the best way of locating the error with your product?

My Answer:

Thanks for your interest in ScrypTik. The easiest way to locate this error is to "view source" in your browser. Then copy this plain text into an editior that shows line numbers (such as ScrypTik), then you can see what is on line 706. Firefox with the HTML tidy plugin does this with view source. Also the Firefox error console will give you a display of the line of code that is giving the error. When developing, I always use Firefox. The firebug plugin is fantastic for AJAX debugging and css issues.

So the answer is that ScrypTik can't really unravel IE error reporting because it does not always know where the Javascript will end up.

Basically, avoid using IE except for testing how your pages look. This should be done every hour so if (when!) something breaks, you have a good idea of what causd it.

Share this using social bookmarking

Anonymous | 3. September 2009 - 11:20

With the Dafizilla ViewSourceWith add-on (http://dafizilla.sourceforge.net/viewsourcewith/), you can specify any app (incl. Scryptik) as your default for viewing source files in any mozilla browser

Post new comment

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Filtered words will be replaced with the filtered version of the word.

More information about formatting options

CAPTCHA
This question tests whether you are a human visitor and prevents automated spam submissions.
Copy the characters (respecting upper/lower case) from the image.