try this code:

        include : function(src,path) {
                if(src.substring(src.length-3)!=".js") src+=".js"
                if (!path) {
                        var path=DynAPI.librarypath
                        var pckg=src.substring(0,src.indexOf('.'))
                        var groupname=src.substring(src.indexOf('.')+1)
                        var realsrc=groupname.substring(groupname.indexOf('.')+1)
                        groupname=groupname.substring(0,groupname.indexOf('.'))
                        if (src.indexOf('.*')>0) {
                                src=src.substring(0,src.indexOf('.*'))
                                if (DynAPI.packages[pckg]) 
group=DynAPI.packages[pckg].libs[groupname]
                                if (group) for (var i in group) document.write('<script
language="Javascript1.2"
src="'+path+pckg+'/'+groupname+'/'+group[i]+'"><\/script>')
                                else alert('include()\n\nThe following package could 
not be
loaded:\n'+src+'\n\nmake sure you specified the correct path.')
                        } else {
                                document.write('<script language="Javascript1.2"
src="'+path+pckg+'/'+groupname+'/'+realsrc+'"><\/script>')
                        }
                } else {
                        document.write('<script language="Javascript1.2"
src="'+path+'/'+src+'"><\/script>')
                }
        }


taken from dynacore version, but it should still work in dynapi... if you
now specify a path variable, it will not use the package/library structure,
but link in that file directly, the way it should work.



Pascal Bestebroer
[EMAIL PROTECTED]
http://www.oibv.com


-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Namens Ben Sargent
Verzonden: donderdag 7 december 2000 8:38
Aan: [EMAIL PROTECTED]
Onderwerp: [Dynapi-Help] Bug in DynAPI.include?


I've been playing around with the newest releases, and I think I may
have found a bug in the DynAPI.include function.  When loading my own
source files like this:

DynAPI.include('myfile.js','js/');

the include function tries to output:

<script language="Javascript1.2" src="js/myfile//js"></script>

It also happens when I try to include 'myfile' instead of 'myfile.js'.

Is this a deliberate change from the earlier 2.0 way of doing this, or a
legitimate bug?

- ben
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help

_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help

Reply via email to