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.

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.

hi,

 

I am using a DHTML Treeview from dhtml.com which is coded in Javascript so i need to load the generated dynamic tree when the user clicks on the dropdown.

 

I need to do the rendering of the treeview before the user clicks on the dropdown.

 

thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.