coderhelpk
coderhelpk

Reputation: 1

load url without refreshing..how to do?

After some scouring I came across this html 5 code

window.history.pushState(“object or string”, “Title”, “/new-url”);

but how do you introduce it? how would I use such a code to change the url to http://google.com without refreshing the page? how about a link or button that would do this?

Upvotes: 0

Views: 312

Answers (1)

ceejayoz
ceejayoz

Reputation: 180023

Per the docs, you won't be able to change the URL to http://www.google.com/ unless the page attempting to make the change is on www.google.com. It'd be a tremendous security risk.

Upvotes: 1

Related Questions