This morning, JS scripts are always written with errors, but I guarantee that there is no problem with the lines prompted, because the line is <input id = "button1" type = "button" value = "button" name = "button1" onclick = "getdiv ()">, how can it go wrong! The error message is that the row has a missing object! Why? I decided it was definitely not an error in this line of statements. I began to analyze the getdiv function. I want to use try-catch to catch it. I will use try catch statements in Js, I used it like this.
Try
{
}
Catch
{
}
// It takes a long time to use C # and does not look at the JS reference. Therefore, it is wrong to follow its ideas.
I checked the JScript reference later, and it specified this for try catch.
Try
{
Trystatements
}
Catch (Exception)
{
Catchstatements
}
Finally
{
Finallystatements
}
Parameters
Trystatement
Required. An error may occur.
Exception
Optional. Any variable name.ExceptionThe initialization value of is the thrown error value.
Catchstatement
Optional. Processing in the associatedTrystatement.
Finallystatements
Optional. The statements that are unconditionally executed after all other processes occur.
However, an error occurs when I remove catchstatement. If I remove Finally, there is no problem.