Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

change href without reloading page js

// 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)
Comment

PREVIOUS NEXT
Code Example
Javascript :: js escape characters 
Javascript :: remove url from string javascript 
Javascript :: $ is not a function 
Javascript :: fetch data in next js 
Javascript :: route component with props 
Javascript :: create an attribute for html with javascript 
Javascript :: regexp object js 
Javascript :: .children javascript 
Javascript :: angular refresh token 
Javascript :: how to remove an object from jsonobject in java 
Javascript :: javascript isalphanumeric 
Javascript :: javascript clear input string 
Javascript :: hover effect in material ui 
Javascript :: nodejs fs root folder path 
Javascript :: javascript canvas reset transform 
Javascript :: javascript selection in iframe 
Javascript :: mongoose get document 
Javascript :: nodejs get param cli 
Javascript :: how to eliminate decimals in js 
Javascript :: inner html jquery 
Javascript :: input type search clear event 
Javascript :: lodash empty string 
Javascript :: change node version 
Javascript :: dynamic event listener jquery 
Javascript :: jquery button top to bottom 
Javascript :: text field material ui max input for number 
Javascript :: jquery active menu 
Javascript :: Regex get emojis 
Javascript :: Angular Laravel has been blocked by CORS policy: Request header field x-requested-with is not allowed by Access-Control-Allow-Headers in preflight response. 
Javascript :: jquery remove focus from all elements 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =