SHARE
TWEET

Untitled

a guest Jun 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var xhr = new XMLHttpRequest();
  2.     var formData = new FormData();
  3.  
  4.     formData.append('text', value);
  5.  
  6.            
  7.         xhr.open("POST", "../contacts/load");
  8.            
  9.         xhr.setRequestHeader('Content-Type', 'text/html');
  10.            
  11.         xhr.send(formData);
  12.    
  13.            
  14.         console.log(value);
  15. ///////
  16.  
  17. $.ajax({
  18.   url: "../contacts/load",
  19.   type: "POST",
  20.   dataType: "html",
  21.   data: { text:value}
  22. });
RAW Paste Data
Want to get better at JavaScript?
Learn to code JavaScript in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top