Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass var of ASP to JavaScript code 1

Status
Not open for further replies.

imendi

Programmer
Oct 14, 2002
33
ES
hi,

I have an asp page where I have some code to read the conents of a text file. That is in asp, using

<%
...
strFileName = Server.MapPath(&quot;/muestras/avisos/actual.txt&quot;)
Set FSysObj = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set TS = FSysObj.OpenTextFile(strFileName, 1, False)

If not TS.AtEndOfStream Then
do While not TS.AtendOfStream
strLine = TS.ReadLine
loop
End If

...
%>

So that gives me a var called strLine with the contents of the txt file.

Then, under this code I have some other code, in JavaScript this time, where I create a marquee and set the contents of it, i.e. the text to display.
Basically, I have

var marqueecontents= a

where I want &quot;a&quot; to be strLine.

I tried
var marqueecontents= <%strLine%> ....... doesn´t work
var marqueecontents= +<%strLine%>+.......doesn´t work
var marqueecontents= +strLine+...........doesn´t work

Any ideas?

Thanks,

im




 
var marqueecontents= &quot;<%strLine%>&quot; _________________________________________________________
for the best results to your questions: FAQ333-2924
[sub]01001111 01101110 01110000 01101110 01110100[/sub]
onpnt2.gif
[sup] [/sub]
 
I forgot the =
var marqueecontents= &quot;<%=strLine%>&quot; _________________________________________________________
for the best results to your questions: FAQ333-2924
[sub]01001111 01101110 01110000 01101110 01110100[/sub]
onpnt2.gif
[sup] [/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top