[removed] IE event.preventDefault is null or not an object

前端 未结 2 766
死守一世寂寞
死守一世寂寞 2020-12-21 16:17

My code works fine in FF/Chrome/Everything except IE(failed in both 7/8, didn\'t bother going furthur down). Due to restrictions, I cannot use jQuery and am hard-coding the

2条回答
  •  Happy的楠姐
    2020-12-21 16:47

    IE has a different event model to other browsers (even IE8). In IE you would call this to do the same thing:

    event.returnValue = false;
    

    You need to determine what the browser supports and call the correct method. So first check if event.returnValue is set, if so then call it, otherwise call preventDefault().

提交回复
热议问题