Quote:
|
Originally Posted by lerura
You can use a location.search ("?")
<a href="products?valueOFvariable">
if i.e. Content[5] is equal to "T_Shirt"
then then line must be:
<a href="products?T_Shirt">
and on the produts page put:
Code:
LS=location.search;
TransferValue=LS.substring(1,LS.length)
;
then TransferValue will be equal to Content[5]
|
okay, i like the approach. is this functional in most browsers?
few questions:
Here's a real example: if i had this as my link:
Code:
<a href="products.html?content[5]">Click here to view Multifor's products</a>
where on the products page would i put
Code:
LS=location.search;
TransferValue=LS.substring(1,LS.length)
also, what i'm not seeing is the "TransferValue" usage... because content[5] is the actual part of the array i wish to load when the page loads.
lemme show you with some truncated code from the products page which you can see in action here:
www.enviromark.ca/english/products.html
Code:
<script>
<!--
var content=new Array()
content[0]='<span>Bindicator</span><br><font size="1">(Celtek Electronics)</font><hr size=1><ul><li><a href="javascript:newWinPDF(\'prodInfo/Bindicator/Phase_Tracker.pdf\');">Phase Tracking</a> continuous level monitoring (Dry and Liquids)</li><li><a href="javascript:newWinPDF(\'prodInfo/Bindicator/loadCell_SpecSheet.pdf\');">Load Cells</a>, yo-yos, etc</ul>'
content[1]='... etc, you get the point'
...
..
.
content[10]...
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
appear()
setTimeout("window.onresize=regenerate",450)
}
}
function changetext(whichcontent){
if (document.getElementsByTagName) {
for(var i = 0;i < fading.length;i++){
clearTimeout(fading[i]);
}
}
if (document.all||document.getElementById){
cross_el=document.getElementById? document.getElementById("descriptions"):document.all.descriptions
cross_el.innerHTML=whichcontent
}
else if (document.layers){
document.d1.document.d2.document.write(whichcontent)
document.d1.document.d2.document.close()
}
initLinkFade();
}
glueHand=changetext;
function nullFunk(){return null};
mousetime=null;
function yarnFace(witchcontent){
changetext=nullFunk;
clearTimeout(mousetime);
glueHand(witchcontent);
mousetime=setTimeout('countDown(5)',0);
}
function countDown(n){
if(!n){
changetext=glueHand;
document.getElementById('countD').style.visibility='hidden'
}
else{
document.getElementById('countD').style.visibility='visible'
document.getElementById('countD').innerHTML=n;
mousetime=setTimeout('countDown('+(n-1)+')',1000);
}
}
function appear(){
document.d1.visibility='show'
}
if (document.layers){
window.onload=regenerate2
}
//-->
</script>
...
</head>
....
<div id="scriptmenu" class="dynamicLinks">
<table cellspacing=0 cellpadding=0 width="70%" align=center border=0>
<tbody>
<tr>
<TD vAlign=top><IMG height=6 alt="" hspace=5
src="images/bull.gif" width=6 vspace=5
border=0></TD>
<TD><span class="link2describe"
onmouseover="status='Bindicator Products';changetext(content[0]);"
onmouseout="status=' '"
onclick="yarnFace(content[0])">Bindicator
</span></TD></TR>
<TR>
<TD colSpan=2>
<HR SIZE=1>
</TD></TR>
</tbody>
</table>
</div>
this is how the script actually works.
so again. where do i place the code on the products.html page and do i need to modify it at all?