S
S
StuGGs2014-08-03 21:17:21
JavaScript
StuGGs, 2014-08-03 21:17:21

Ajax navigation: how to get rid of duplicate script loading?

Hello!

While developing the site, I encountered the following problem:
1) There is ajax navigation using the history API
2) With such navigation, the same scripts, when visiting different pages, are loaded several times, which leads to the fact that when you click on any element, the event on it fires several times.

How can I prevent an already loaded script from being loaded again?
Or maybe it's possible to nullify the previously loaded script?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor It doesn't matter, 2014-08-03
@HellFir-e

the simplest:
look for a block that loads on all pages and once, and paste the code there.
The method is comparable to the poke method, but it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question