JSFiddle - React, Tailwind, and code Playground
by Joseph Rex
JavaScript
var invocation = new XMLHttpRequest();
invocation.open('GET','http://api.ipify.org/?format=jsonp',true);
invocation.send();
invocation.addEventListener("load", transferComplete, false);
invocation.addEventListener("error", transferFailed, false);
invocation.addEventListener("abort", transferCanceled, false);
function transferComplete(evt) {
console.log(evt);
}
function transferFailed(evt) {
console.log("The transfer failed.");
}
function transferCanceled(evt) {
console.log("The transfer is canceled.");
}