日期:2014-05-17  浏览次数:20785 次

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;
         }
 
------解决方案--------------------
引用:
JavaScript code?123456789101112function EditItem(obj) {   if (window.event) //IE                {            window.event.returnValue = false;} else{   window.event.preventDefault(); }   ……


我用火狐调试 好像根本就没进function IE中正常的!
------解决方案--------------------
没人回答了吗