473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Passing variables between ASP and Javascript

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.
Jul 19 '05 #1
2 10846


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/

Jul 19 '05 #2
This works for me...

var sDocument = new String('<%=sDischargeInstructionDocument%>');

HTH

"Gung Ho" <mi***********@netlane.com> wrote in message
news:rf********************@golden.net...
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.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Consuelo Guenther | last post by:
Hello, I am having problems with passing variables between pages. I have the following: First asp page has the function: -----------------------------------------------------------------------...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
5
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the...
2
by: brianwmunz | last post by:
Hi, I'm having a problem passing a variable through a URL because the variable is supposed to hold a URL that has a variable of its own. Here is an idea of what I'm trying to do: href="javascript:...
6
by: Eric Johnston | last post by:
I want the visitor to enter three numbers on the page and then click a button "generate image" which will I hope cause a generated gif image to be displayed alongside on the page. This involved...
9
by: Max | last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong here as I'm not able to pass a simple variable to a function. In the head of doc I have: <script...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
3
by: jsdeveloper | last post by:
Hi, I just started programming in javascript, and I'm having a problem passing variables between javascript and asp code in .asp page. Can you please help? I've given the sample code below. ...
1
by: johnjsforum | last post by:
Buddies, I have a web page to create HTML buttons dynamically as in the “formDivColorPicker” function ////////////////////////////////////////////////////////////////////////////////////...
3
by: q-rious | last post by:
Hello All, 1. I would like to pass some variables (x and y below) from Javascript to PHP, process them in PHP, and return some other variables (a abd b) back to Javascript. --(x,y)--...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.