Commit 7125bf73 authored by Martin Lees's avatar Martin Lees
Browse files

Small js rewrite

parent 3fe0cbe9
......@@ -26,32 +26,27 @@
}
// Make the actual CORS request.
function makeCorsRequest() {
var url = "http://localhost:8002";
var xhr = createCORSRequest('POST', url);
var params = "username="+username+"&permlink="+permlink+"&tag="+tag;
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Content-length", params.length);
if (!xhr) {
return;
}
// Response handlers.
xhr.onload = function() {
var data = JSON.parse(xhr.responseText);
$("#steempress_sp_price")[0].innerHTML = data.payout;
$("#steempress_sp_comments")[0].innerHTML = data.comments;
};
xhr.send(params);
}
makeCorsRequest();
}
$(window).load(load_steem_capabilities)
var url = "http://localhost:8002";
var xhr = createCORSRequest('POST', url);
var params = "username="+username+"&permlink="+permlink+"&tag="+tag;
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Content-length", params.length);
if (!xhr) {
return;
}
// Response handlers.
xhr.onload = function() {
var data = JSON.parse(xhr.responseText);
$("#steempress_sp_price")[0].innerHTML = data.payout;
$("#steempress_sp_comments")[0].innerHTML = data.comments;
};
xhr.send(params);
}
$(window).load(load_steem_capabilities)
})( jQuery );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment