By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,730 Members | 1,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,730 IT Pros & Developers. It's quick & easy.

Page gets stuck... How to load javascript before page loads

P: 1
Hi,

I have a very peculiar situation at hand. I am to load a page with images and drop down menu's and flyouts.. Needless to say i am using javascripts.. If i click on some links or flyouts before the page loads completely, the page gets stuck. I have to wait for the page to load completely, before i can do any operation. Kindly suggest me some means of getting around this. I desperatley need a solution..
I am calling a function on window.onload. I know this is where the issue is. As window.onload waits for the entire page to load. So is there any way of loading the scripts before the page loads completely? Any help in this regard would be greatly appreciated...
Aug 25 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Welcome to TSDN!

One possibility for solving this if your page is taking too long to load is to just have HTML on the page. Then use unobtrusive Javascript techniques to load the Javascript after the page as loaded.

You could use getElementsByTagName(tagname) and getElementById(id) to access elements and then set attributes, properties, etc.

This will mean that your page will not be fully functional when the page has loaded, but at least it won't get stuck.
Aug 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.