HTML and CSS Reference
In-Depth Information
For example, if you are checking to see if two expressions are equal, you should use the
== equality operator, not the = assignment operator.
2.5 Debugging Tools
To see your where errors have occurred in your JavaScript programs, modern browsers
provide an error console window.
Table 2.2 Browser Error Console
Browser
How to Invoke Error Console
Internet Explorer
Double-click the little yellow triangle in the left corner
Firefox
Tools/Error Console
Safari
Develop/Show Error Console
Opera9
Tools/Advanced/Error Console script Options/
2.5.1 Firefox
Error Console. You an b ing up the ror conso e for F fox by going to
“Tools/Error Console” The Console displays the lines containing the errors. Leave the
console open and watch your errors build up. There is a “Clear” option to refresh the
error console window. The following JavaScript program contains an error that will be
displayed in the Error Console window as shown in Figure 2.4.
EXAMPLE 2.3
<html>
<head>
<title>First JavaScript Sample</title>
</head>
<body bgcolor="lavender">
<font size="+2">
1
<script type = "text/javascript">
2
document.writeln("<h2>Welcome to the JavaScript World!</h2>);
// Bug in line2: Missing double quote!!
</script>
This is just plain old HTML stuff.
</font>
</body>
</html>
 
 
 
Search WWH ::




Custom Search