18.04.2016 Views

Professional JavaScript For Web Developers

javascript for learners.

javascript for learners.

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Error Handling<br />

Figure 14-4<br />

Be aware that the line number given isn’t always accurate. If the code causing the<br />

error is inline, then the line number correctly identifies the line number in the<br />

HTML file where the error occurs; if the code causing the error is in an external file,<br />

the line number is typically off by one line, so an error that is purported to have<br />

occurred on line 5 actually occurred on line 4.<br />

Internet Explorer (MacOS)<br />

By default, Internet Explorer on the Macintosh doesn’t show <strong>JavaScript</strong> errors. To turn on this feature, go<br />

to the Preferences dialog (available under Edit ➪ Preferences). Under the <strong>Web</strong> Browser section on the<br />

left side of the window, click <strong>Web</strong> Content. In the lower part of the window, you see a check box labeled<br />

Enable Scripting; immediately underneath is a check box labeled Show Scripting Error Alerts. Checking<br />

this box causes the browser to pop up an error message when a <strong>JavaScript</strong> error occurs.<br />

415

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!