Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

xhr post send

var xhr = new XMLHttpRequest();
var params = 'field1='+postfield1+'&field2='+postfield2;
xhr.open('POST', 'http://exmaple.com', true);

//Send the proper header information along with the request
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');

xhr.onload = function() {//Call a function when the state changes.
    if(xhr.status == 200) {
        alert(this.responseText);
    }
}
xhr.send(params);
Comment

PREVIOUS NEXT
Code Example
Javascript :: convert json string to json object in java 
Javascript :: javascript how to raise the error 
Javascript :: javascript filter unique 
Javascript :: beautify json in html 
Javascript :: flattenDeep in es 6 without lodash 
Javascript :: javascript key pressed enter 
Javascript :: replace url without reload js 
Javascript :: create module with routing by angular 
Javascript :: settime out with promise 
Javascript :: update angular materia; 
Javascript :: code Execution time in nodejs 
Javascript :: Jquery trigger change event upon dom ready 
Javascript :: js today timestamp 
Javascript :: how to comment in the react javascript 
Javascript :: transitionduration 
Javascript :: get child routes using parent in angular 
Javascript :: javascript get list of files in directory 
Javascript :: json rename key 
Javascript :: destructure dynamic properties 
Javascript :: how to check which key is pressed in jquery 
Javascript :: npm redux toolkit 
Javascript :: iterate object js 
Javascript :: fetch data flutter json 
Javascript :: javascript parse json string 
Javascript :: Get the Status Code of a Fetch HTTP Response 
Javascript :: iterata a array in js 
Javascript :: react native android safeareaview 
Javascript :: how could you implement javascript into java 
Javascript :: get last element in array in js 
Javascript :: javascript undefined check 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =