Advertisement
eqeqwan21

Untitled

Dec 27th, 2024
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(async function() {
  2.     let result;
  3.     let userTown;
  4.     if (environment.login_name.indexOf("_") !== -1) {
  5.         userTown = '&town='+ environment.login_name.split('_')[0].toLowerCase()
  6.     }
  7.     else{
  8.         userTown = ''
  9.     }
  10.     try {
  11.         result = await $.ajax({
  12.             url: environment.base_url+"/"+'?do=api&fn=devices&id=' + get['id']+userTown,
  13.             type: 'GET',
  14.             dataType: "json"
  15.         });
  16.     } catch (error) {
  17.         console.error(error);
  18.         $("#content").html("<h2>Device was not loaded</h2>");
  19.         return;
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement