My webpage is a .asp file.
Is it possible to read a value from external file and store it in a javascript var.
The external file only contains a price (digits and a decimal point).
The filename is price1.asp but can be .txt, .inc, .whatever....
var price1=(199.95);
I want to put the price 199.95 into the external file price1.asp.
This doesn't work, but will help you understand what I want to achieve.
var price1=(<!--#include file="include/price1.asp"-->);
This is no good either, because I can't store the value in the javascript variable.
<%
Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.OpenTextFile("d:/test.txt")
price1 = wfile.ReadLine
wfile.close
Set wfile=nothing
Set fs=nothing
%>
// This showed the correct value
<%
response.write (price1)
%>
I don't know database, is there another way.
Is it possible to read a value from external file and store it in a javascript var.
The external file only contains a price (digits and a decimal point).
The filename is price1.asp but can be .txt, .inc, .whatever....
var price1=(199.95);
I want to put the price 199.95 into the external file price1.asp.
This doesn't work, but will help you understand what I want to achieve.
var price1=(<!--#include file="include/price1.asp"-->);
This is no good either, because I can't store the value in the javascript variable.
<%
Set fs = CreateObject("Scripting.FileSystemObject")
Set wfile = fs.OpenTextFile("d:/test.txt")
price1 = wfile.ReadLine
wfile.close
Set wfile=nothing
Set fs=nothing
%>
// This showed the correct value
<%
response.write (price1)
%>
I don't know database, is there another way.
Last edited:












