Gung Ho wrote:
I am using ASP to open a text file on the server and I want to pass
variables to Javascript.
Any suggestions?
For example - I have a text file on the server defining a set of pictures.
I open the text file to retrieve the list of files. I want to pass the list
of files to the Javascript which will then display the data on the client
machine.
Well, you control the server while you don't control the client
(JavaScript might not be supported or enabled) therefore I am not sure
why you want client-side JavaScript to display the data. Can't you
simply use ASP to display the data?
Of course you can make your ASP page create client side JavaScript code
but that hardly has advantages.
If you are looking for a way to exchange data between client side
JavaScript and ASP without changing the URL of the page displayed in the
browser then you could use remote scripting or Msxml2.XMLHTTP to
exchange data. Remote scripting relies on an Java applet I think while
Msxml2.XMLHTTP works only with IE5+/Win (although Netscape 6/7 has a
XMLHttpRequest object to do similar).
--
Martin Honnen
http://JavaScript.FAQTs.com/