1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Rep Power

    trying to add javascript variable value in url

    hi all,
    i am trying to have a variable value passed in a url..
    something like

    <a href = "abc.html?final=flag">

    now the above works well, but say i want to have flag as a variable whose value i am determining in javascript:

    <script language = javascript>
    flag = 1;

    how do i
    1) retrieve the value of the variable flag out side javascript?
    2) how would i attach teh variable value to the url?

    please help, have been digging on and on....and cant seem to solve this problem. thanks .
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Rep Power

    You could try something like

    <script language = javascript>
    document.write('<a href = "abc.html?final=' + flag + '">');

    Bye ...

IMN logo majestic logo threadwatch logo seochat tools logo