????????????????????<div?class="modal-body">
????????????????<form?action=""?class="form?center-block"?onsubmit="login()">
????????????????????<div?class="form-group">
????????????????????????<input?type="text"?id="username"?class="form-control?input-lg"?placeholder="請(qǐng)輸入用戶名">
????????????????????</div>
????????????????????<div?class="form-group">
????????????????????????<input?type="password"?id="password"?class="form-control?input-lg"?placeholder="請(qǐng)輸入密碼">
????????????????????</div>
????????????????????<div?class="form-group">
????????????????????????<button?class="btn?btn-primary?btn-lg?btn-block"?type="submit">登錄</button>
????????????????????</div>
????????????????</form>
????????????????????</div>
????????
<script?type="text/javascript">
?function?login()?{
?var?un?=?document.getElementById("username").value;
????????var?pw?=?document.getElementById("password").value;
????????if?(un?==?"admin"?&&?pw?==?"admin")?{
?window.open("TXL.html",?'_blank');
????????????this.window.close();
????????????return?true;
?}
?else?{
?alert("登錄失敗");
????????????return?false;
?}
????}
</script>
為什么提交表單后,原窗口不會(huì)關(guān)閉?
耂虍
2016-12-27 17:49:11