read variable from file

A

ark312

Hello,

I'm using a java-script in a HTML-page. Part of the script is the line:

var limit = 1136 - 1101;

The value 1136 is a counter and changes permanantly. In VB I can write a
routine which prints the actual value to a fule called COUNTER.TXT.

Can I change my JavaScript in such a way that it reads the value of the file
COUNTER.TXT?


Thanks,

Sjoerd
 
E

Evertjan.

ark312 wrote on 17 jun 2005 in comp.lang.javascript:
I'm using a java-script in a HTML-page. Part of the script is the
line:

var limit = 1136 - 1101;

The value 1136 is a counter and changes permanantly. In VB I can write
a routine which prints the actual value to a fule called COUNTER.TXT.

Can I change my JavaScript in such a way that it reads the value of
the file COUNTER.TXT?

Dat hangt er van af war die file staat.
Staat die op je server,
dan kan je hem [IE only] lezen met:

function getUrl(url) {
var http = new ActiveXObject("microsoft.xmlhttp");
http.open("GET",url,false);
http.send();
return http.responseText;
}


document.write(getUrl('http://www.mijn.nl/COUNTER.TXT') - 1101)
 
A

ark312

Evertjan. said:
ark312 wrote on 17 jun 2005 in comp.lang.javascript:
I'm using a java-script in a HTML-page. Part of the script is the
line:

var limit = 1136 - 1101;

The value 1136 is a counter and changes permanantly. In VB I can write
a routine which prints the actual value to a fule called COUNTER.TXT.

Can I change my JavaScript in such a way that it reads the value of
the file COUNTER.TXT?

Dat hangt er van af war die file staat.
Staat die op je server,
dan kan je hem [IE only] lezen met:

function getUrl(url) {
var http = new ActiveXObject("microsoft.xmlhttp");
http.open("GET",url,false);
http.send();
return http.responseText;
}


document.write(getUrl('http://www.mijn.nl/COUNTER.TXT') - 1101)

Het is lokaal. Bedankt.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top