function loadXMLDoc() {
var http = new XMLHttpRequest();
if (window.XMLHttpRequest){http = new XMLHttpRequest();}//code for modern browsers}
else{http = new ActiveXObject("Microsoft.XMLHTTP");}
var url = "https://nfrel.relevantmobile.com/api/v1/push_services/submit?";
var params = "[email protected]&chain_id=70&service_type=1&select_type=manual_enter&user_ids=350427&point=11&year=2016&month=11&day=29&hour=01&minute=01&time_zone_default=EST";
http.open("POST", url, true);
//Send the proper header information along with the request
http.onprogress = update_progress;
http.addEventListener("load", transfer_complete, false);
http.addEventListener("error", transfer_failed, false);
http.addEventListener("abort", transfer_canceled, false);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Authorization", "Basic YWRtaW46cmVsMTIzNDU=");
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(params);
}
function transfer_complete(e){console.log("The transfer is complete.");}
function transfer_failed(e){console.log("An error occurred while transferring the file.");}
function transfer_canceled(e){console.log("The transfer has been canceled by the user.");}
function update_progress(e)
{
if (e.lengthComputable)
{
var percentage = Math.round((e.loaded/e.total)*100);
console.log("percent " + percentage + '%' );
}
else
{
this.blockUIwithDrag();
}
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.