show and hide keep open through query string

Posted on 2011-10-17
Last Modified: 2012-06-27
with the example below I was wondering if I pass the id below to a querystring how can my javascript read it and keep open

/******************* html example *//////////////////////////
<a href=javascript:showhide('AIR_FRESHENERS','AIR_FRESHENERS_Image','../images/');><img src='..\images\expand.gif' border=0 id='AIR_FRESHENERS_Image'></a><a name='A'>&nbsp;&nbsp;AIR_FRESHENERS</a></td>
      </tr><tr id="AIR_FRESHENERS" style="display:none;">

/************ Javascript *******************************\
function showhide(which,img,imgsrc) {

      if(document.all && !document.getElementById) {
            document.getElementById = function(id) {
                   return document.all[id];
      if (document.getElementById){
            oWhich = document.getElementById(which).style;
            oImage = document.getElementById(img);
      } else {
            if (document.layers) {
                  oWhich = document.layers[which];
                  oImage = document.layers[img];
Question by:sevensnake77
    LVL 28

    Accepted Solution

    You will need to have some sort of server-side coding that will put the id into a javascript variable:

    var myFeildId = '<%= Request.QueryString["MyId"] %>';
    LVL 9

    Author Comment

    I can just convert the javascript to server side but where will the var myfeidid be added, can you add to my javascript current
    LVL 9

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This article shows how to read a single webpage's HTML into a string variable, and it also shows how to automate a sequence so you can read and process a list of webpages.  I was tasked with reading and parsing a series of webpages to collect some s…
    In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now