✔ 最佳答案
Try the following code:
<html>
<head><title>window.open</title>
<SCRIPT LANGUAGE=“JAVASCRIPT”>
<!-- hide JavaScript code from browsers that are not JavaScript enabled
function popupwin() {
if (username==“xxx” && password==“xxx”) {
window.open('
http://hk.yahoo.com', 'popup', 'height=500, width=400, menubar=no, scrollbars=no, status=no, toolbar=no, screenX=100, screenY=0, left=100, top=0');
}
else {
alert(“帳號或密碼錯誤,請重試!”);
}
}
</SCRIPT>
</head>
<body>
<FORM NAME=“FORM1”>
Username: <INPUT type=“text” name=“username”><BR>
Password: <INPUT type=“text” name=“password”><BR>
<INPUT TYPE=“BUTTON” VALUE=“Popup Window” ONCLICK=“popupwin();”>
</FORM>
</body>