Create a variable link

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

    Create a variable link

    Hi,

    I must begin to say that I'm rather new in wtiting and using JavaScript. Now
    I want to use JavaScript in a HTML-page. On the homepage is a link. Every
    time the homepage is displayed the link must point to another target. I want
    to realize this by having a lot of differet targetpages. The names of these
    pages are p1001.htm until p<nnnn>.htm. At this moment the last is p1153.htm,
    but the amount is increasing every day.
    I have a file named "counter.tx t" which contains one line with the string of
    the last targetpage, at his moment "1153".

    My idea is to have a JavaScript which:
    1. reads the file counter.txt to determine the last available page
    2. then takes at random one number between 1001 and 1153,
    3. sets the HREF-link to page p<random>.htm.

    I know it must be possible in JavaScript, but can anyone help me?

    Thanks,


  • Mick White

    #2
    Re: Create a variable link

    asd987 wrote:
    [color=blue]
    > Hi,
    >
    > I must begin to say that I'm rather new in wtiting and using JavaScript. Now
    > I want to use JavaScript in a HTML-page. On the homepage is a link. Every
    > time the homepage is displayed the link must point to another target. I want
    > to realize this by having a lot of differet targetpages. The names of these
    > pages are p1001.htm until p<nnnn>.htm. At this moment the last is p1153.htm,
    > but the amount is increasing every day.
    > I have a file named "counter.tx t" which contains one line with the string of
    > the last targetpage, at his moment "1153".
    >
    > My idea is to have a JavaScript which:
    > 1. reads the file counter.txt to determine the last available page
    > 2. then takes at random one number between 1001 and 1153,
    > 3. sets the HREF-link to page p<random>.htm.
    >
    > I know it must be possible in JavaScript, but can anyone help me?
    >
    > Thanks,
    >[/color]
    Did you not see my response in DW forum?
    Mick

    Comment

    Working...