Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
How to change URL without load in JavaScript

I have a question How to change URL without load. I am working on a PHP, JavaScript project. I am try to make without load Home page. in home Header section content some buttons like :-

Header Button

Header

on click button than load data using XMLHttpRequest() and i want to change Url like:-

https://example.com/home to https://example.com/search

Code

var xmld = new XMLHttpRequest();
    xmld.open("GET", "/Api/SearchPage", true);
    xmld.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmld.onreadystatechange = function() {
        if (xmld.readyState == 4 && xmld.status == 200) {
            var json = JSON.parse(xmld.responseText);
            if (json.Status == "Ok") {
                doument.querySelector("#content").innerHTML = json.HTMLData;
                window.location.href = "https://exmaple.com/Search"; // without load
            }
        }
    }
    xmld.send();

in example, when you click item than url change without load

I am not use any js and php framework

Example

https://dribbble.com/

https://in.pinterest.com/

it's possible??

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

if you don't use a framework window.history.pushState() will do the thing you want. See this link: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState

about 4 years ago · Juan Pablo Isaza Denunciar

0

Use a state manager like Redux with a modern Javascript framework like ReactJs.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda