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

167
Views
convertir XMLHTTPRequest a jquery ajax

Intenté muchas formas de convertir mi XMLHTTPRequest en jQuery ajax pero no pude tener éxito.

Agradecería mucho si alguien pudiera ayudarme a resolver este problema.

aquí está mi código XMLHttpRequest:

 var url = url; var xhr = new XMLHttpRequest(); xhr.open("POST", url); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { console.log(xhr.status); console.log(xhr.responseText); }}; var data = "ajax=1"; xhr.send(data);

y aquí está mi intento pero no funciona

 $.ajax({ url: "<?php echo $this->ui_url('onlineexamcats', 'all'); ?>", data: JSON.stringify("ajax=1"), type: "POST", processData: false, contentType: false, beforeSend: function(xhr){xhr.setRequestHeader('Content-Type', "application/x-www-form-urlencoded");}, success: function(res) { console.log(res); } });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba esto

 $.ajax({ url: "<?php echo $this->ui_url('onlineexamcats', 'all'); ?>", data: "ajax=1", type: "POST", processData: false, success: function(res) { console.log(res); } });
about 4 years ago · Juan Pablo Isaza Report
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!