From: jonathan e. <eis...@st...> - 2003-11-19 15:06:52
|
Greetings, I've looked through the archives and haven't found this subject, so Basic question: Can the dynapi libraries be loaded after the page has been loaded. Goal: All dynapi functionality on the page is secondary. So, I would like the page to load and render without having to wait for dynapi to come down the pipe. Yes, download times over modems is an issue. Ideally, I would like to be able to do the following: <script language="JavaScript" src="/library/dynapi3x/src/dynapi.js" type="text/JavaScript"></script> <script language="JavaScript"> var allLoaded = false; dynapi.onLoad(function () { dynapi.library.setPath('/library/dynapi3x/src/'); dynapi.library.include('dynapi.library'); dynapi.library.include('dynapi.api'); dynapi.library.include('dynapi.gui.LoadPanel'); dynapi.library.include('DragEvent'); allLoaded = true; }); </script> However, when it comes time to use it, I typically get javascript errors such as "LoadPanel has no properties", etc. And yes, I do make sure that dynapi is not used until the above function completes. I have tried various forms, including a setTimeout("a-load-the-libraries-function"), etc., but to no avail. The closest I have come is putting the include statements as the last script on the page, just before the </body> tag. However, this is not entirely reliable: sometimes the page will render before the includes are finished, sometimes the page will not render before the includes are finished. It appears that the libraries must be loaded before page load finishes. If this is so, then let me know. Else, if there are other fatal logic flaws, then send them on. Thank you for your time, jde |