script to choose random source file

I

Individual.Net

Hi!

I'm using a javascript with a separate .js file. In order to get the load
time of the page down to a minimum I am thinking of using several .js files.
And I would now like my javascript to choose one of the .js file randomly.
It would be nice if I could name the files getcontent1.js, getcontent2.js
and so on, and that the script could choose randomly between them, and that
it uses a different source file every day, or every hour.
Is this possible? And how is it done in the easiest, fastest loading way?
Anyone that can help me?

Between the <head> tags it looks like this:

<script language="JavaScript" src="getcontent.js">
</script>

Is it possible to just modify these lines? Further down it looks like this:

<script language="JavaScript"><!--
var before = '<font size="4" <font color="#000000"> <b> <font
face="BernhardFashion BT">';
var after = '</font>';
var content = getcontent();
document.write(before + content + after);
// -->
</script>

As you can understand - I'm not at all used to write or modify scripts.
Thanks in advance.

/ Johan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top