Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

xmlhttprequest javascript

let xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function(){
    if(this.readyState === 4 && this.status === 200)
      {
        document.getElementById('response-div').innerHTML = this.responseText
      }
    }
	//get request with params
    xhr.open('GET', 'example?param1=true&param2=2');
  xhr.send();
});
 
PREVIOUS NEXT
Tagged: #xmlhttprequest #javascript
ADD COMMENT
Topic
Name
4+1 =