Skip to content
Advertisement

window.history.pushState function reloads the page when used

i am trying to go from page to page without reloading, i read on other questions that i can use

JavaScript

to not reload the page, but it is still reloading the page.

i also tried using this function but kept giving me a syntax error

JavaScript

the syntax error occurs and it reads: “unexpected token ,”

here is an example of my HTML:

JavaScript

what can i do to get my pages not to reload?

Advertisement

Answer

Try this href=”javascript:void(0)” in tag a

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement