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 |
From: Doug M. <do...@cr...> - 2003-11-19 15:53:16
|
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.541 / Virus Database: 335 - Release Date: 11/14/03 |
From: Doug M. <do...@cr...> - 2003-11-19 17:56:41
|
Okay.. Lookout Express screwed up the last email.. doh. Okay.. I believe there should be a frames demo in the examples folder. This shows you how to use teh dynapi in one frame from another. My suggestion to you is, assuming that frames are an option, use a hidden frame to load the dynapi when you need it. Alternatly, you can load the Base DynAPI without the libraries, and then load the additional libraries when you need them (I assume that you can do that..) Doug ----- Original Message ----- From: "jonathan eisenhamer" <eis...@st...> To: <dyn...@li...> Sent: Wednesday, November 19, 2003 10:06 AM Subject: [Dynapi-Help] Is it possible to load libraries after a page has been loaded. > 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 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > https://lists.sourceforge.net/lists/listinfo/dynapi-help > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.541 / Virus Database: 335 - Release Date: 11/14/03 |
From: jonathan e. <eis...@st...> - 2003-11-19 19:52:23
|
At 12:58 PM 11/19/2003 -0500, you wrote: >Alternatly, you can load the Base DynAPI without the libraries, and then >load the additional libraries when you need them >(I assume that you can do that..) Well, this is what I thought I was doing per the code snippet originally sent. However, while looking for the frame example, I did run across the example for the extension to library to dynamically load libraries. This appears to be just changing all the dynapi.library.include into dynapi.library.load statements. See the new code snippet below. This all works fine except for DragEvent. At the 'dynapi.library.load("DragEvent")', Mozilla produces an exception with the text "Object cannot be created in this context". Through some testing, it appears that if 'dynapi.api' is loaded dynamically, the DragEvent initialization fails. Summary: the dynapi.library.load method is what I want, and does work. But DragEvent breaks. Code Snippet: <script language="JavaScript" src="/library/dynapi3x/src/dynapi.js" type="text/JavaScript"></script> <script language="JavaScript"> dynapi.library.setPath('/library/dynapi3x/src/'); dynapi.library.include('dynapi.library'); </script> <script language="JavaScript"> dynapi.onLoad( function() { dynapi.library.load('dynapi.api'); dynapi.library.load('dynapi.gui.LoadPanel'); dynapi.library.load('DragEvent'); dynapiLoaded = true; } ); </script> |