Click to See Complete Forum and Search --> : must be a better way to do this


havik
02-05-2003, 11:41 AM
Hello everyone,

This is my code for a scrolling text box:

// The message goes here
var message = "Basically anything goes in here, html code as well";

// Then it is written within the <div> layer
document.write(message);

What I would like to do is to put the message into a .txt file and read from that into the message variable. However, after searching I'm under the impression that Javascript can't do this directly for security reasons.

I have no problem with the way it's coded right now but my users who will have access to change the message might not be to happy with this method.

Any ideas will be greatly appreciated.

Havik

gil davis
02-05-2003, 11:51 AM
Javascript has no file I/O capabilities. However, if you can't get your users to do it any other way, take a look at http://www.faqts.com/knowledge-base/view.phtml/aid/1899/fid/130 for a possibility.

pyro
02-05-2003, 11:53 AM
It'd be easy with PHP...Is that an option?

havik
02-05-2003, 12:00 PM
I wish, but the internet provider is that I use is very limited in what they can support. Ask them and they'll say no, and it's not my call to get another provider (that call comes from the people above).

But I'll check out the above URL and report back with any success.

Thanks,

Havik