To get your code work, you need to remove the <script> tags from your
include method.
But anyway, as Michael said, the included code is executed only after the
original. This leads you to problems if you would like to use the include
like:

Main.include("util/objectUtil.js");
objectUtil.anyMethod(); //objectUtil is not yet usable.

BTW: Could somebody that has the power to do the tricks change the settings
of the mailing list to back what it used to be. Now I need to choose the
correct recipient manually.

--
Tuomas Huhtanen

> I am using a custom-built javascript file include function (code at bottom
> of email)
> to include .js files within other .js files, and have created some code
> that works fine in IE and NS6, but crashes NS4.7 (the page never finishes
> loading).
>
> The root file has the following four lines:
>       <script language="Javascript" src="main.js"></script>
>       <script language="Javascript">
>       Main.include("level1.js")
>       </script>
>
> The problematic lines in level1.js are as follows:
>
> Main.include("/util/objectUtil.js")
> Main.include("/util/arrayUtil.js")
> Main.include("/util/stringUtil.js")
> Main.include("/select/select.js")
>
> If I comment out all but one of the includes, the code is ok:
> it only crashes when I try to include more than one file.  Does anyone
> have any idea what's causing this?
>
> thanks,
> jonah
>
> Code for main.js
> ------------------
> function Main() {}
> Main.include = includeFile
> Main.basePath = "/tms/js"
>
> function includeFile(name,path) {
>       var path = path ? path : Main.basePath
>       fullPath = path + name
>       document.writeln('<script language="Javascript" src="' + fullPath +
> '"><\/script>')
> }
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dynapi-help


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

Reply via email to