[JavaScript] JS div to remain visible

Laurent Muchacho LaurentM at london.virgin.net
Tue Jun 22 12:06:49 CDT 2004


Hi Alan,

The only way I know how to do this is by passing the value of which link as
been pass through the querystring.
I explain

on your link <a href="page2.asp?divClicked=name_or_id_of_your_div">Page2</a>
 
after on the next page you either use ASP or Javascript to get the value
from the querystring and populate a variable with the value

ASP
var myVariable = <%=request.querystring("divClicked")%>;

Javascript
var myVariable = QueryString('divClicked');
this is the js function to get the querystring value
function QueryString(param){
	var loca = document.location.href;
	if(loca.indexOf('?' + param + '=')>-1 || loca.indexOf('&' + param +
'=')>-1){
		var qString = loca.split('?');
		var keyVal = qString[1].split('&');
		for(var i=0;i<keyVal.length;i++){
			if(keyVal[i].indexOf(param + '=')==0){
				var val = keyVal[i].split('=');
				return val[1];
			}
		}
		return false;
	}else{
		return false;
	}
};


then when the page load (I mean on the onload of the body like
onload="toggle('myVariable ')") you can simply call your function 

et voila 

Laurent

ps: I attached your file back with solution implemented unfornetely it will
remenber only the one you had click at the end 


-----Original Message-----
From: Alan Easton [mailto:alaneaston666 at hotmail.com]
Sent: 22 June 2004 17:41
To: javascript at LaTech.edu
Subject: [Javascript] JS div to remain visible


Hello People,

I am in need of some help.

I have a html page that has some div tags on. When you click each div tag, 
it toggles a table of links below it in another div tag to be either visible

or hidden.

Now the problem I have it that when I click on one of the links in the table

that has been made visible, it goes to a page with the exact same navigation

structure on it, but I would like the table that was made visible to remain 
visible.

Is there some way I can check to see which div tag has been made visible as 
I go to the link. I have attached the html file so you can see what I am 
doing.

Any ideas or help would be grateful.

Thanks,

Alan...

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger



This E-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you have received this E-mail in error please notify the system manager.  This message contains confidential information and is intended only for the individual named.  If you are not the named addressee you should not disseminate, distribute or copy this E-mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HTMLPage12.htm
Type: application/octet-stream
Size: 2111 bytes
Desc: not available
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040622/3d8b08f4/attachment.obj>


More information about the Javascript mailing list