event.preventDefault() function not working in IE

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

Following is my JavaScript (mootools) code:

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


        
11条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 02:41

    Mootools redefines preventDefault in Event objects. So your code should work fine on every browser. If it doesn't, then there's a problem with ie8 support in mootools.

    Did you test your code on ie6 and/or ie7?

    The doc says

    Every event added with addEvent gets the mootools method automatically, without the need to manually instance it.

    but in case it doesn't, you might want to try

    new Event(event).preventDefault();
    

提交回复
热议问题