src/js/loader.js
// load data from url and pass to callback
load data from url and pass to callback
load data from url and pass to callback
function data(Url,Cb) {
  var xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function (e) {
    if (xhr.readyState == 4){
      if (xhr.status == 200) {
        Cb(xhr.responseText);
      } else {
        console.log("Error: ("+xhr.status+")");
      }
    }
  };
  xhr.open('GET',Url,true);
  xhr.send();
}
function data ( Url , Cb ) { var xhr = new XMLHttpRequest ( ) ; xhr . onreadystatechange = function ( e ) { if ( xhr . readyState == 4 ) { if ( xhr . status == 200 ) { Cb ( xhr . responseText ) ; } else { console . log ( "Error: (" + xhr . status + ")" ) ; } } } ; xhr . open ( 'GET' , Url , true ) ; xhr . send ( ) ; }
load data from url and pass to callback
load data from url and pass to callback