Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    query strings in javascript

    how do i retrieve parameters in html from a link such as: http://mysite.com/?param=1
    does anyone know how to retrieve that information in javascript?

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could try something like this -

    function blah() {
    linkquery=location.href.split("?");
    query=linkquery[1]
    }

    Think that should work?

    'query' is the text after the '?', so then you can do what you want with it...

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how would i display what is after the ?param=
    Last edited by cra992; 06-02-2005 at 10:50 PM.


  •  

    Posting Permissions

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