?
Solved

show and hide keep open through query string

Posted on 2011-10-17
3
Medium Priority
?
203 Views
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) {
location.pathname;

      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];
            }
      }
0
Comment
Question by:Seven price
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
strickdd earned 1500 total points
ID: 36980644
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"] %>';
0
 
LVL 9

Author Comment

by:Seven price
ID: 36980686
I can just convert the javascript to server side but where will the var myfeidid be added, can you add to my javascript current
0
 
LVL 9

Author Closing Comment

by:Seven price
ID: 37058049
tks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

864 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