I am using javascript in a jsp page to make some changes [adding a row in the table] to the current HTML page. The addition is happening successfully, but when i am about to exit from the function the page is getting reloaded.
How to avoid the page reloading and, show the page without any change in the scroll.
Add
return falseat the end of the function if it’s an event handler.I’ve seen people usually recommend
event.preventDefault()but I’ve personally had it fail on some browsers for me. So not quite sure if that will work just as well.