Link to home
Start Free TrialLog in
Avatar of joyacv2
joyacv2Flag for Puerto Rico

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
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Can you post a link or some source code - not much we can do on the description above.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_248744
Member_2_248744
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of joyacv2

ASKER

Thank You very much! Your answer confirm my analysis!