function showMessage()
{
var num=new Array('25926419','9920084590','9867988449','28758869','28521181');
var contact= document.getElementById('contact').value;
if (num.indexOf(contact) > -1)
{
window.location='address-directory.php';
}
else
{
document.getElementById('errordiv').innerHTML="you are not allowed to see Member Details";
$("#myModal").modal('show');
return false;
}
}
window.location在此函数中无效,我想将其重定向到另一个页面
答案 0 :(得分:0)
function showMessage()
{
var num=new Array('25926419','9920084590','9867988449','28758869','28521181');
var contact= document.getElementById('contact').value;
if (num.indexOf(contact) > -1)
{
window.location='address-directory.php';
}
else
{
document.getElementById('errordiv').innerHTML="you are not allowed to see Member Details";
$("#myModal").modal('show');
}
return false;
}
现在正在工作...... 我在之前的其他部分写过返回false ..............