How can events be prevented from stopping to work after an ajax request?



How can events be prevented from stopping to work after an ajax request?..

Answer / Anil Raj Meena

[n {n "method": "event.preventDefault(),n "example": "n let form = document.querySelector('form');n form.addEventListener('submit', function(event) {n event.preventDefault();n // AJAX request here...n });"n }n]

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

How to delete cookies in jquery?

1 Answers  


Whether we need to add jQuery file in both Master and Content page?

1 Answers  


How is the deferred method in jquery important in relation to animate method?

1 Answers  


Different ways of using $.connect function in jquery?

1 Answers  


What is the difference between jquery.size() and jquery.length?

1 Answers  


What is the difference between prop and attr?

1 Answers  


You get "jquery is not defined" or "$ is not defined" error. What could be the reason?

1 Answers  


Explain the use of jquery .each() function? : jquery mobile

1 Answers  


How can we show and hide an element via jquery?

1 Answers  


Can we use our own specific character in the place of $ sign in jQuery?

1 Answers  


What is difference between onload and ready?

1 Answers  


What is cdn and how jquery is related to it?

1 Answers  


Categories