Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Vanilla Javascript AJAX Function
var http_request = new XMLHttpRequest();"GET", "{% url 'api_categories' %}");
http_request.onreadystatechange = function(){
var DONE = 4;
var OK = 200;
if (http_request.readyState === DONE){
if (http_request.status === OK){
} else {
console.log("Error: " + http_request.status);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.