Chapter 3 - Client-Side Scripting Language
Chapter 3 - Client-Side Scripting Language
1
By Seiyfu Yesuf
Runtime Errors
Runtime errors, also called exceptions, occur during execution (after
compilation/interpretation).
ASU/Computing/Computer Scienc Internet Programing/2019 by Seiyfu Y. 23
The following line causes a runtime error because here the
syntax is correct, but at runtime, it is trying to call a method that
does not exist.
window.printme();
Logical Errors
Logic errors can be the most difficult type of errors to track down. These
errors are not the result of a syntax or runtime error.
Instead, they occur when you make a mistake in the logic that drives your
script and you do not get the result you expected.
You cannot catch those errors, because it depends on your business
requirement what type of logic you want to put in your program.
function myFunc() {
var a = 100;
try {
alert("Value of variable a is : " + a );
}
catch ( e ) {
alert("Error: " + e.description );
}
finally {
alert("Finally block will always execute!" );
} }
How It Works ?
Your server sends some data to the visitor's browser in the form of a
cookie.
The browser may accept the cookie. If it does, it is stored as a plain text
record on the visitor's hard drive.
Now, when the visitor arrives at another page on your site, the browser
sends the same cookie to the server for retrieval.
Once retrieved, your server knows/remembers what was stored earlier.