<form method="POST" name="submitForm2" >
<div align="center">
<input type="submit" name="goto" value="Logon" onClick="encode()">
[code=JScript] <script>
function encode(){
alert("System Logout.");
}
</script>
</div>
</form>[/code]
<div align="center">
<input type="submit" name="goto" value="Logon" onClick="encode()">
[code=JScript] <script>
function encode(){
alert("System Logout.");
}
</script>
</div>
</form>[/code]
Event thread: click
Error:
name: ReferenceError
message: Statement on line 1: Reference to undefined variable: encode
Backtrace:
Line 1 of script
encode();
At unknown location
[statement source code not available]
JavaScript - http://192.168.1.45/
Inline script compilation
Syntax error while loading: line 450 of inline script at http://192.168.1.45/ :
document.submitForm2.goto.click();
document.submitForm2.goto.click();
这是ie下才支持的,改成
encode();
<div align="center">
<input type="button" name="goto" value="Logon" onClick="encode()">
</div>
</form>