joyacv2
asked on
document ready and window load not always working
Hi,
I have a code that executes some lines of code on document ready or window load. My problem is that sometimes the code works and sometimes not. I see that if i press the refresh button on the browser, always work well. But when I enter to the page from other page using href, sometimes work and sometimes not. I try with cache disabled, link follow by parameter, use full url, but nothing works.
When works, works well, but there is sometimes that doesn't work. I notice that when the network is a little slow, the problem is frequent. But with the refresh always work, any idea?
My page works with jquery and angular js. The thing that most intrigue me is why sometimes work and sometimes don't!
When I enclose the document ready in a setTimeout function and gives a time of 1 or 2 seconds then works
I have a code that executes some lines of code on document ready or window load. My problem is that sometimes the code works and sometimes not. I see that if i press the refresh button on the browser, always work well. But when I enter to the page from other page using href, sometimes work and sometimes not. I try with cache disabled, link follow by parameter, use full url, but nothing works.
When works, works well, but there is sometimes that doesn't work. I notice that when the network is a little slow, the problem is frequent. But with the refresh always work, any idea?
My page works with jquery and angular js. The thing that most intrigue me is why sometimes work and sometimes don't!
When I enclose the document ready in a setTimeout function and gives a time of 1 or 2 seconds then works
Can you post a link or some source code - not much we can do on the description above.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You very much! Your answer confirm my analysis!