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

93
Views
Actualización de contenido con onpopstate

Tengo un concentrador que carga páginas en un div con la clase 'principal' y trato de averiguar cómo poder ir y venir usando los botones del navegador. Tengo lo siguiente en la página de configuración:

 clickHandler(null, null, 'settings');

Esto llama a lo siguiente:

 function clickHandler(one,two,three) { history.pushState(one, two, three); }

Sé que hasta esta parte, está pasando la variable 'configuración' ya que la barra de direcciones muestra /settings al navegar hacia atrás. Entonces, para intentar obtener settings.php para cargar en 'main', estoy intentando lo siguiente:

 function updateContent(data) { if (data == null) return; console.log(data); $(".main").load(data+'.php'); } window.onpopstate = function(event) { console.log("location: " + document.location + ", state: " + JSON.stringify(event.state)); updateContent(document.location) };

Sin embargo, a menos que presione hacia atrás dos veces muy rápido, no está cargando la página correcta.

about 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!