Horje
a tag how to trigger ajax Code Example
a tag how to trigger ajax
document.querySelector("#myId").onclick = function(e) {
  e.preventDefault();
  
  $.ajax({
    url: 'api_url',
    type: 'post',
    data: {key: 'value'},
  })
  .done(function() {
    console.log("success");
  })
  .fail(function() {
    console.log("error");
  });
}
a tag how to trigger ajax

e.preventDefault();





Javascript

Related
mouse wheel scroll sections in react Code Example mouse wheel scroll sections in react Code Example
underline unused code vscode Code Example underline unused code vscode Code Example
discord.js send dm to specific user Code Example discord.js send dm to specific user Code Example
push a new route only triggers URL change but not location change Code Example push a new route only triggers URL change but not location change Code Example
JS binary search Code Example JS binary search Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6