event.preventDefault() function not working in IE

后端 未结 11 2584
栀梦
栀梦 2020-11-22 02:22

Following is my JavaScript (mootools) code:

$(\'orderNowForm\').addEvent(\'submit\', function (event) {
    event.prev         


        
11条回答
  •  再見小時候
    2020-11-22 02:39

    I was helped by a method with a function check. This method works in IE8

    if(typeof e.preventDefault == 'function'){
      e.preventDefault();
    } else {
      e.returnValue = false;
    }
    

提交回复
热议问题