Help - Search - Members - Calendar
Full Version: Performance issues
xFX JumpStart Public Forums > DHTML Menu Builder > <developers' edition>
jeffbr
The problem is, the javascript code for all the api calls is taking too long to process on the client side and causing a major delay in the loading of the page, about 21 seconds.

I have approximately 95 commands and approximately 19 groups in our Intranet.  I am building the whole menu system dynamically with the api methods of the de edition. - .9k -

I have tried to put the code into its own .js file to include it for browser caching and it did not work.

Has anyone else ran into this?  Any solutions or ideas I may try?  Thanks for the input.
Hywel
I write out the menu options to a .js file for http://diverserecords.com/.  The site uses content management, and everytime the client edits the site the menu file is re-written.  Works a treat, but it still has to parse the JavaScript to add the menu groups and commands.  Using a .js file rather than writing the content dynamically using your server-side process won't change that.
jeffbr
I agree with you, but are you saying then that you are able to write it with the server side code?  This is ultimately what I would like to do with it so that the browser does not have to take the time to parse the script.  Please advise if you know how to do this.  Thanks.
Hywel
QUOTE
but are you saying then that you are able to write it with the server side code


I use PHP to scan a database for the "catalogue" and "forthcoming" drop-down links on the site I mentioned earlier.  I then write the JavaScript code out to a file called mainmenu.js.  This file is called with a standard <script src=... block.

You cannot avoid having the browser parse the JavaScript.  Even the standard edition requires the browser to parse the hundreds of lines of JavaScript to create the menu.  However, my method separates the static DMB-generated code from my dynamically generated code, so at least some of it gets cached by the browser.

Are you saying that once the page has downloaded the menus are taking 21 seconds to appear, or are you saying that the page takes 21 seconds to download?  If you mean the former, it looks as though your computers aren't up to handling the menus; caching the JavaScript won't help with this either.  JavaScript is parsed and compiled in real-time, just as BASIC was before VB5 came along, so it's inherently slow.  That isn't help by the fact that browsers are also extremely slow beasts.

Perhaps you could write some custom functions that populate the menu once the user has moused over an option, rather than creating the entire menu as the page loads.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.