Hi, I basically want to make a program that will rotate advertisements randomly (picture and hyperlink) in all my web pages. For this, I need to load the advertisements into an array and basically select a random item from that array. To avoid having to add all the data into each and every web page, I’d want to load my array up from a file, on the server. So, my problem is: “How do I load up a Javascript array with data that is in a file? Thank you your help is greatly appreciated and valued. I have this for now, and it is not getting interpreted as server side because when I check the source code, the code (other than the
Content-type: text/html\n
x = new File(“source.txt”);
fileIsOpen = x.open(“r”);
if (fileIsOpen)
{
while (!x.eof())
{
for (var i = 0; i < 3; i++)
{
pic[i] = x.readln();
}
for (var i = 0; i < 3; i++)
{
linker[i] = x.readln(); }
for (var i = 0; i < 3; i++)
{
compnay[i] = x.readln();
}
for (var i = 0; i < 3; i++)
{
linkwords[i] = x.readln();
}
for (var i = 0; i < 3; i++) {
lastwords[i] = x.readln();
}
}
}