Sunday, September 5, 2010

JavaScript Debugging

Here's a quick tip for debugging JavaScript . . . JavaScript is flat. Thus, an error somewhere higher on the page will cause JavaScript to fail further down the page. If you have looked at that JavaScript you just added and can't figure out why it isn't working, start from the top. Look for some of the less obvious causes:

  • Check permissions on external files
    If your users don't have permission, they can't read in the file, references will fail
  • Check anything that might have been affected by find/replace on your page, you may have messed up something else.
  • Check for closed tags
  • Check for more global misspellings.
Anything above the JavaScript you just added might affect it.

No comments:

Post a Comment