I've just started learning a little JavaScript. When I make an error in my code all I see is a blank page in my browser.
Is there any way to turn on error reporting, so that I can see where my coding errors are?
Thanks!
| SitePoint Sponsor |



I've just started learning a little JavaScript. When I make an error in my code all I see is a blank page in my browser.
Is there any way to turn on error reporting, so that I can see where my coding errors are?
Thanks!
Fergal Crawley (Previous Username: Proudirish.com)
Business Advice Forum - Webmaster and Business Forum < Get a free link & win $5,000
Forum Promotion

Just open the error console - that's where the error messages get displayed. See http://javascriptexample.net/basics98.php for instructions on where to find it in various different browsers.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">

To add to what felgal says, I wrote a short blog post about this - maybe it helps: Simple JavaScript debugging with Chrome’s console
Edit: A more advanced video tutorial: http://www.youtube.com/watch?feature...v=N8SS-rUEZPg#!
How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog

Nice tutorial with a clear explanation of how the console works.
The one thing you left out in the mention of alert() as a not so good alternative is that Chrome, Safari and Firefox will display a checkbox on the second and subsequent times the alert appears so that you can skip the rest of the alerts and Opera displays an extra checkbox every time allowing you to turn off JavaScript for the page. So if you figure out the problem on the first or second alert you can skip the rest. Not as convenient as using the console though.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">

How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog
Bookmarks