[Javascript] Loading Problem

Tim Makins spindrift at oceanfree.net
Wed Sep 15 06:26:28 CDT 2004


Thanks Hakan, but all is OK now, for Internet Explorer at least. The phrase
'script loader' hadn't occured to me, but when you mentioned it, (clap clap
clap) I tried it as a search term on Google, and came up with some ideas
that got me to try the following:


if (sel_table > 0) {// has a table been selected ?
var file_names = ["","state", "uscount1", "uscount2", "uscount3"];
var url = 'gaz/table_'+ file_names[sel_table] +'.js';
document.write('<script src="', url, '" type="text/JavaScript"><\/script>');
}


It won't work as a called-function once the page has been loaded, but if I
include it in the head and let it run through whilst the page is being
loaded, it works fine. Maybe one of our cross-browser experts could comment
on whether it will work outside of IE - at the moment my test page only
works on IE !!

Tim in Ireland.

----- Original Message ----- 
From: "Hakan M (Backbase)" <hakan at backbase.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Wednesday, September 15, 2004 11:10 AM
Subject: Re: [Javascript] Loading Problem


> I have a dynamic script loader thing here somewhere, working in IE5+ and
> Mozilla at the least. If it's interesting, I'll dig it up.
>
> Regards,
> H




More information about the Javascript mailing list