www.webdeveloper.com
Results 1 to 2 of 2

Thread: Request.QueryString for Javascript

  1. #1
    Join Date
    Oct 2004
    Posts
    18

    Request.QueryString for Javascript

    I've been looking for a way to pass a parameter via a normal HTML link and to then retrieve the value in the same way as you do in ASP using Request.Querystring. Well I found the following article on how this can be achieved:

    http://andrewu.co.uk/tools/request/

    Now my question is that I want to use the parameter passed via the HTML link to decide on what DIV container is made visible to the user. For example, the HTML link might something like viewfiles.html?sport=football. Then on my viewfiles.html page I will have a separate DIV container for Football, Golf, Rugby, Swimming. All of these DIV containers will be hidden except for the one associated with the value of the 'sport' parameter passed in the HTML link. So in this example all of the DIV containers will be hidden except for the Football DIV container. The article above does a good job of explaining how the parameter is retrieved in the HTML link but I don't know it can then be used to make the DIV container visible. Any ideas?
    The answers are out there.......it's just a matter of finding them!!

  2. #2
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,634
    Associate the variable passed with the id of the div, ie if sport=football:
    PHP Code:
    document.getElementById(sport).style.display="block";
    ...
    <
    div id="football".... 
    54 68 65 42 65 61 72 4D 61 79

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles