jQuery event.preventDefault() not working in Firefox (JSFiddle included)

前端 未结 5 535
梦毁少年i
梦毁少年i 2020-12-04 13:17

This is a kind of similar duplicate to some others here, but I think I\'m using event.preventDefault() correctly in this case.

Here\'s a JSFiddle you ca

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 13:53

    The variable event in your code is not initialized.

    http://jsfiddle.net/SeEw2/4/

    extract :

     $('#ajaxsearch').click(function(event) {
    
            // Stop the Search input reloading the page by preventing its default action
            event.preventDefault();
    

提交回复
热议问题