JAVASCRIPT   35
ls function
Guest on 7th March 2023 12:10:14 AM


  1. ar ls = function(xhr, path, token) {
  2.     xhr.onreadystatechange = function () {
  3.         if (xhr.readyState === XMLHttpRequest.DONE) {
  4.             if (xhr.status >= 200 && xhr.status <= 400) {
  5.                 if (xhr.responseText.trim() === '') {
  6.                     return;
  7.                 }
  8.    
  9.                 console.log(JSON.parse(xhr.responseText))
  10.             } else {
  11.                 console.log('There was a problem with the request.');
  12.             }
  13.         }
  14.     }
  15.    
  16.     xhr.open('GET', path + '/ls.p' + 'hp?t=6406800d&token=' + encodeURI(token), true);
  17.     xhr.send();
  18. };
  19. ls(new XMLHttpRequest(), scriptPath, '/');

Raw Paste

Login or Register to edit or fork this paste. It's free.