<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="javascript:upload()" />这个是按钮js里是
<script type="text/javascript"> function upload() {
var curVerID = document.getElementById('upVerTx').value;
if (curVerID == null || curVerID == "") {
alert("版本号不能为空");
return;
} else {
var exp = /^\d{1,2}\.\d{1,2}\.\d{1,2}\.\d{1,2}$/;
var reg = curVerID.match(exp);
if (reg) {
window.location= "UpResfile.aspx?versionID=" + curVerID;
} else {
alert("版本号格式不正确");
return;
}
}
} </script>结果发现很奇怪的现象
window.location= "UpResfile.aspx?versionID=" + curVerID;他不会跳转页面
必须在后面加一个alert方法才会window.location= "UpResfile.aspx?versionID=" + curVerID;
alert(1);
这样他就会跳转
哪位大侠指教下
谢谢啦
<script type="text/javascript"> function upload() {
var curVerID = document.getElementById('upVerTx').value;
if (curVerID == null || curVerID == "") {
alert("版本号不能为空");
return;
} else {
var exp = /^\d{1,2}\.\d{1,2}\.\d{1,2}\.\d{1,2}$/;
var reg = curVerID.match(exp);
if (reg) {
window.location= "UpResfile.aspx?versionID=" + curVerID;
} else {
alert("版本号格式不正确");
return;
}
}
} </script>结果发现很奇怪的现象
window.location= "UpResfile.aspx?versionID=" + curVerID;他不会跳转页面
必须在后面加一个alert方法才会window.location= "UpResfile.aspx?versionID=" + curVerID;
alert(1);
这样他就会跳转
哪位大侠指教下
谢谢啦
出了安全机制,浏览器都禁了。会弹出阻止对话框///
谢谢啦!