Java code
Copy codeThe Code is as follows:
<Html>
<Head>
<Title> javascript </title>
<Script type = "text/javascript">
Function test (inVal ){
Try {
InVal = inVal. toUpperCase ();
} Catch (error ){
Alert ("An exception has occurred. Error was: \ n" + error. message );
}
}
</Script>
</Head>
<Body>
<Input type = "button" value = "Test" onclick = "test (null);">
</Body>
</Html>
Copy codeThe Code is as follows:
<Html>
<Head>
<Title> javascript </title>
<Script type = "text/javascript">
Function test (inVal ){
Try {
InVal = inVal. toUpperCase ();
} Catch (error ){
Alert ("An exception has occurred. Error was: \ n" + error. message );
}
}
</Script>
</Head>
<Body>
<Input type = "button" value = "Test" onclick = "test (null);">
</Body>
</Html>
Use firebug of firefox to tune bugs
Reference
Copy codeThe Code is as follows:
<Html>
<Head>
<Title> javascript </title>
<Script type = "text/javascript">
Function test (){
Var a = 0;
Console. log ("checkpoint 1 ");
A = a + 1;
Console. log ("checkpoint 2 ");
A = A-1;
Console. log ("checkpoint 3 ");
A = a. toLowerCase ();
Console. log ("checkpoint 4 ");
}
</Script>
</Head>
<Body>
<Input type = "button" value = "Test" onclick = "test (null);">
</Body>
</Html>
You can add a method to IE.
Reference
Copy codeThe Code is as follows:
Function Console (){
This. log = function (inText ){
Alert (inText );
}
}
Var console = new Console ();