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

    Join Date
    Feb 2001
    Posts
    3
    Rep Power
    0

    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;
    </script>

    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
    Posts
    464
    Rep Power
    14
    Hi,

    You could try something like

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

    Bye ...
    :-)

IMN logo majestic logo threadwatch logo seochat tools logo