Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AJAXcall(_data, returnFunction) {
- if (!returnFunction) {
- returnFunction = function(){};
- }
- var req = $.ajax({
- url: "ajax?cacheFucker="+Math.random(),
- type: "POST",
- data : _data,
- xhrFields: { withCredentials: true},
- success: function(data, textStatus, jqXHR) {
- returnFunction(data);
- jqXHR.abort();
- },
- error: function (jqXHR, textStatus, errorThrown) {
- returnFunction(false);
- jqXHR.abort();
- }
- });
- }
- function loadShit() {
- AJAXcall({action:"onlinePlayers"}, function(json) {
- allOnlinePlayers = $.parseJSON(json);
- });
- }
- setInterval(function() {
- loadShit();
- }, 3000);
Add Comment
Please, Sign In to add comment