Jump to content

Using onload to fetch data hidden from user


biggieuk

Recommended Posts

Hi all,

 

I have created a custom dropdown box which when clicked loads a dynamically generated xml file and populates a DHTML Treeview.

 

This process is currently taking far too long to load the div once clicked (4-6 seconds). Is it possible to somehow use the onload of the page to load this hidden div before the user clicks my dropdown?

 

Simply using the function i have now adds the 4-6 second delay onto the page loading time and the user is unable to do anything until this has loaded. Can this be loaded completely in the background so the user can still interact with the page during this 4-6 sec delay?

 

thanks for any help with this.

Link to comment
Share on other sites

You can use onload, or if you're using a framework such as jquery specify the function to run once the page has loaded. Set the div to display: none in your css.

 

Where the user used to click to load the div, use a simple function to change the display style of the div to block. That should allow you to load the div once the page has loaded, and when the user clicks it will just show the div as required.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.