R
Roopa
Hi all
I am not so good at javascript. Can anybody tell me debug this ?
This is a program which calls otherpage with a variable and the layer div1
should be hidden or shown depending on the variable I am sending across to
the otherpage.htm
firstpage.htm
==========
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>first page</title>
</head>
<body>
<a href="otherpage.htm?vis=yes">Get other page</a>
</body>
</html>
Otherpage.htm
===========
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>otherpage</title>
<script language="JavaScript"><!--
var vis = qsobj(0)
var param = 'div1';
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null
}
function disappear(param)
{
document.getElementById(param).style.visibility = 'hidden';
// param.style.visibility="hidden";
}
function reappear()
{
document.getElementById(param).style.visibility = 'visible';
//param.style.visibility="visible";
}
if (vis == 'yes'){
reappear('div1')
}
else {
disappear('div1')
}
//--></script>
</head>
<body>
Hello
<div style="position: absolute; width: 100px; height: 34px; z-index: 1;
left: 11px; top: 60px; visibility:hidden" id="div1">
Hidden layer</div>
</body>
</html>
Thanks,
I am not so good at javascript. Can anybody tell me debug this ?
This is a program which calls otherpage with a variable and the layer div1
should be hidden or shown depending on the variable I am sending across to
the otherpage.htm
firstpage.htm
==========
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>first page</title>
</head>
<body>
<a href="otherpage.htm?vis=yes">Get other page</a>
</body>
</html>
Otherpage.htm
===========
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>otherpage</title>
<script language="JavaScript"><!--
var vis = qsobj(0)
var param = 'div1';
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null
}
function disappear(param)
{
document.getElementById(param).style.visibility = 'hidden';
// param.style.visibility="hidden";
}
function reappear()
{
document.getElementById(param).style.visibility = 'visible';
//param.style.visibility="visible";
}
if (vis == 'yes'){
reappear('div1')
}
else {
disappear('div1')
}
//--></script>
</head>
<body>
Hello
<div style="position: absolute; width: 100px; height: 34px; z-index: 1;
left: 11px; top: 60px; visibility:hidden" id="div1">
Hidden layer</div>
</body>
</html>
Thanks,