read variable from file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ark312

    #1

    read variable from file

    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




  • Evertjan.

    #2
    Re: read variable from file

    ark312 wrote on 17 jun 2005 in comp.lang.javas cript:
    [color=blue]
    > 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?
    >[/color]

    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.xmlht tp");
    http.open("GET" ,url,false);
    http.send();
    return http.responseTe xt;
    }


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



    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)

    Comment

    • ark312

      #3
      Re: read variable from file


      "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
      news:Xns967893E E6578Aeejj99@19 4.109.133.242.. .[color=blue]
      > ark312 wrote on 17 jun 2005 in comp.lang.javas cript:
      >[color=green]
      >> 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?
      >>[/color]
      >
      > 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.xmlht tp");
      > http.open("GET" ,url,false);
      > http.send();
      > return http.responseTe xt;
      > }
      >
      >
      > document.write( getUrl('http://www.mijn.nl/COUNTER.TXT') - 1101)
      >
      >
      >
      > --
      > Evertjan.
      > The Netherlands.
      > (Replace all crosses with dots in my emailaddress)
      >[/color]

      Het is lokaal. Bedankt.


      Comment

      Working...