“Cambiar URL por jQuery sin actualización de actualización” Código de respuesta

Cambiar URL por jQuery sin actualización de actualización

// Current URL: https://my-website.com/page_a
const nextURL = 'https://my-website.com/page_b';
const nextTitle = 'My new page title';
const nextState = { additionalInformation: 'Updated the URL with JS' };

// This will create a new entry in the browser's history, without reloading
window.history.pushState(nextState, nextTitle, nextURL);

// This will replace the current entry in the browser's history, without reloading
window.history.replaceState(nextState, nextTitle, nextURL);

Cambiar URL por jQuery sin actualización de actualización

// Current URL: https://my-website.com/page_a
const nextURL = 'https://my-website.com/page_b';
const nextTitle = 'My new page title';
const nextState = { additionalInformation: 'Updated the URL with JS' };

// This will create a new entry in the browser's history, without reloading
window.history.pushState(nextState, nextTitle, nextURL);

// This will replace the current entry in the browser's history, without reloading
window.history.replaceState(nextState, nextTitle, nextURL);

Respuestas similares a “Cambiar URL por jQuery sin actualización de actualización”

Preguntas similares a “Cambiar URL por jQuery sin actualización de actualización”

Más respuestas relacionadas con “Cambiar URL por jQuery sin actualización de actualización” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código