Page does not take JS files later

0

I have a problem, I searched the internet and I did not find it, I saw that there is a similar question here in the Stack, but it did not solve my problem.

It is as follows, I have several files in JS, such as one of "Show More", where he searches for more news, he picks up the next news from another file that is search.php, now what happens is the following, some news has galleries that use JS, the main page takes correctly, but when I click on Show More it shows the news but when I click to see the gallery does not work, to work I have to include that same JS on that page search.php, but it turns out that the page is a bit heavy because it will have 2 JS equal that do the same function. This is normal? Does JS not handle later files?

NOTE: I did not put the code here, because it is too large.

    
asked by anonymous 08.11.2016 / 02:25

1 answer

0

People, I kept breaking my head with this for days, and I did not think so, and the solution was very simple, follow it for those who have this problem:

$ ('body'). on ('click', '.curtir', function () {

Just put the $ ('body'). because then it puts on the page after the function

    
12.11.2016 / 07:35