H
H
habrdima2019-02-01 18:25:14
JavaScript
habrdima, 2019-02-01 18:25:14

Where to put the js file on the page so that it works for the changed link?

Using the history api, the history.pushState({}, "", href) method I change the link,
I load the content via ajax, and, as it were, a new page,
the js file is on the main page,
if you refresh the page, then js does not work, as I understand from the fact that the link is now different,
what then to do? js file needs to understand that an update is taking place, and not follow the link

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question