Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
AJAX: solicitud asíncrona que no devuelve booleano

Estoy tratando de devolver verdadero o falso dependiendo de si el token y el rol de los usuarios en el almacenamiento local están bien. Por alguna razón, no estoy definido como respuesta... ¿Podrían ayudarme?

 function isLogged(roleNeeded) { var token = "asd";//localStorage.getItem("token"); function handleResponse(data){ ajaxresponse = data; var val; var localRole = "s";//localStorage.getItem("role"); val = (data.status === "ok" && localRole === roleNeeded); return val; } loadAjax(token, handleResponse) } function loadAjax(token, handleResponse) { $.ajax({ url: 'http://localhost/users/login/verify', method: 'GET', headers: {token: token}, success: function(data) { handleResponse(data) } }); }
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!