Well IMO if the browser is only firing "loading" and
"loaded" readyState then this should ssolve your
problem:

s.onreadystatechange = function() {
   if (s.readyState == 'loaded')  {
     alert("complete");
     func();
   }
}

If that failes then why not just use dynapi.js and the
library files?

<script language="JavaScript"
src="../src/dynapi.js"></script>
<script language="Javascript">
   dynapi.library.setPath('../src/');
   dynapi.library.include('dynapi.library');
</script>
<script language="Javascript">
   dynapi.library.load('myscript.js')
</script>

It's that simple :)

--
Raymond Irving


--- "Mark Proctor (mproctor)" <[EMAIL PROTECTED]>
wrote:
> I hope you don't mind me asking here as its not a
> dynapi issue, I'm
> having problems with my code, and noticed that you
> seemed to have got
> around this - dynapi/dynapi3x/src/ext/library.js
> 
> I'm finding that the 'complete' readyState isn't
> fireing, just 'loading'
> and 'loaded'. This script is to dynamically load
> data at user's request.
> To get around it I currently have the loaded script
> called a function
> loaded(); which tells the main program its loaded
> and execute func();
> But I really want to decouple the loading script
> from the main block
> with something like below- (please ignore browser
> detection etc, its
> just a test file, I'm only interested in ie5.5+ at
> this stage):
> 
> function getConcept(name, func) {
>   if (document.getElementById("concept_"+name))
> return;
>   var s = document.createElement("SCRIPT");
>   s.src = '/mdf/vocabulary/'+name + '.js';
>   s.type = 'text/javascript';
>   s.defer = true;
>   if(document.all) {
>     s.onreadystatechange = function() {
>       if (s.readyState == 'complete')  {
>         alert("complete");
>         func();
>       }
>     }
>   } else {
>     s.onload = func;
>   }
>  
>
document.getElementsByTagName('HEAD')[0].appendChild(s);
> }
> 
> 
>
-------------------------------------------------------
> This SF.net email is sponsored by: SlickEdit Inc.
> Develop an edge.
> The most comprehensive and flexible code editor you
> can use.
> Code faster. C/C++, C#, Java, HTML, XML, many more.
> FREE 30-Day Trial.
> www.slickedit.com/sourceforge
> _______________________________________________
> Dynapi-Dev mailing list
> [EMAIL PROTECTED]
>
http://www.mail-archive.com/[EMAIL PROTECTED]/


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/


-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to