Results 1 to 4 of 4

Thread: how can i pass javascript varaibles in url?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681

    how can i pass javascript varaibles in url?

    hi,
    how can i pass javascript varaibles in url?

    Thanks and Regards
    vivek.s

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: how can i pass javascript varaibles in url?

    Code:
    var queryString = "?myKey=myValue";
    window.location = window.location + queryString;
    This won't work if you already have query strings...

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681

    Re: how can i pass javascript varaibles in url?

    Hi!

    Thanks a lot!

    would i be able to append javascript variables on <a href=> tag?

    Thanks and Regards
    vivek.S

  4. #4
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: how can i pass javascript varaibles in url?

    The easiest way would be to have your href point to the javascript (href=javascript:function-name) and then let the javascript build the querystring and do a location.replace using the querystring

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width