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

148
Views
El script JS no se carga en la solicitud ajax

Tengo esta función para llamar a un sitio web basado en un clic.

 function toURI(event, that) { event.preventDefault(); const url = that.getAttribute('href'); var request = new XMLHttpRequest(); request.open("GET", url, true); request.onload = function () { if (this.status >= 200 && this.status < 400) { // Success! document.querySelector("#mainInnerBody").innerHTML = this.response; // console.log(this.response); } else { // We reached our target server, but it returned an error } }; request.send(); //This is where we update the address bar with the 'url' parameter window.history.pushState("object", "New Title", url); }

Cuando ejecuto esta función en cada

 <a href="http://localhost/new/nav/index.php?bank=option_1" onclick="toURI(event, this)"> <div class="dropdown-list__item">Option 1</div> </a>

Y esto es lo que está obteniendo en la pestaña de red cada vez:

ingrese la descripción de la imagen aquí

Ahora, cada vez que solicita css/html, todo excepto el archivo javascript y ese archivo javascript está dentro del cuerpo.

about 4 years ago · Juan Pablo Isaza
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!