JS页面跳转
function EditItem(obj) {
window.event.returnValue = false;
window.location.href='ShipBaseInfoEdit.aspx?ID=' + obj;
return true;
}
这样写了 IE8 中可以跳转 为什么火狐中不可以跳转 是兼容问题吗?
[解决办法]
ff下,要这样:
window.event.preventDefault();
window.location.href='ShipBaseInfoEdit.aspx?ID=' + obj;
return true;
[解决办法]
function EditItem(obj) {
if (window.event) //IE
{
window.event.returnValue = false;
}
else
{
window.event.preventDefault();
}
window.location.href='ShipBaseInfoEdit.aspx?ID=' + obj;
return true;
}