Question Regarding preventDefault();

Question Regarding preventDefault();

lesalgado47lesalgado47 Posts: 40Questions: 14Answers: 0

Hello I have a question regarding a statement I have come across on one of the init samples:
https://editor.datatables.net/examples/simple/inTableControls.html
What does the following statement mean ? --
// Delete a record
e.preventDefault();

and what does this statement mean ?
does that apply the action to the id closest?
editor.edit( $(this).closest('tr'), {

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin
    Answer ✓

    It stops the browser from following the link (and potentially taking you to another page or reloading the current one). Details about preventDefault are available in the excellent MDN documentation.

    Allan

This discussion has been closed.