After refreshing the page jquery stops working

This is a really strange problem, I have quite a few plugins and user scripts on my page, and as a rule, everything works fine, but if I try to refresh the page, donโ€™t just click on some link, some of my scripts just stop working, basically those who change css properties, my firebug doesn't show any errors, what could be the reason for something like that?

+6
source share
2 answers

Reply from the original poster:

So the problem was that I used $(document).ready() , which I really needed was $(window).load()

+5
source

I know this is an old question that I came across. In any case, my answer may help another when the same problem arises. Unfortunately, I have no reputation to comment on Trott's answer above.

At the same time, if you use jQuery 1.8 or any $(window).on('load', function() {... }); version after it, then use $(window).on('load', function() {... }); , $(window).load() deprecated in jQuery version 1.8 and there will be a jquery url.indexOf is not a function error. jquery url.indexOf is not a function (at least in jQuery 3.4.1)

0
source

Source: https://habr.com/ru/post/907699/


All Articles