묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
이소스가 왜 오류나는지좀 알려주세용!!꼭 부탁 드립니다.
2003.04.18 10:53
<html>
<head>
<title>http://perlbbs.com 초보자를 위한 펄 CGI 프로그램 및 자료실</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<style type="text/css">
<!--
body {font-family: "고딕", "Helvetica", "sans-serif"; font-size: 10px; xline-height:150%; color: #000000}
table {font-family: "고딕", "Helvetica", "sans-serif"; font-size: 10px; xline-height:100%; color: #000000}
A:link { text-decoration: none; color:#333333}
a:visited { color: #333333; text-decoration: none}
a:hover { color: blue; text-decoration: underline} -->
</style>
<script language="javascript">
<!--
var main_cnt = 6
function showhide(num) {
for (i=1; i<=main_cnt; i++) {
menu=eval("document.all.block"+i+".style");
imgch=eval("document.bar"+i);
if (num==i) {
if (menu.display=="block") {
menu.display="none";
imgch.src="+.gif";
}else {
menu.display="block";
imgch.src="-.gif";
}
//}else {
// menu.display="none";
// imgch.src="+.gif";
}
}
}
function show(num) {
for (i=1; i<=main_cnt; i++) {
menu=eval("document.all.block"+i+".style");
imgch=eval("document.bar"+i);
if (num==i) {
menu.display="block";
imgch.src="-.gif";
}else {
menu.display="none";
imgch.src="+.gif";
}
}
}
//-->
</script>
</HEAD>
<BODY onLoad="MM_preloadImages('../images/menu_02X.gif','../images/menu_08X.gif','+ '+ '../images/menu_06X.gif')">
<SCRIPT language="JavaScript">
document.cookie.expires="0";
</SCRIPT>
<TABLE borderColor=white cellSpacing=0 cellPadding=0 width=155 border=0>
<TR>
<TD style="CURSOR: hand" onmouseover="show(1);" xonclick="showhide(1);">
<IMG name=bar1 src="+.gif" border=0 width=1 height=1><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','../images/menu_02X.gif',1)">
<img src="../images/menu_02.gif" name="Image7" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD> <SPAN id=block1 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand"></span></td>
</tr>
<TR>
<TD xonclick="showhide(2);" onmouseover="show(2);" style="CURSOR: hand">
<IMG name=bar2 src="+.gif" border=0 width=1 height=1><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','../images/menu_08X.gif',1)">
<img src="../images/menu_08.gif" name="Image8" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD> <SPAN id=block2 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand">
<TABLE cellSpacing=0 cellPadding=0 border=0 WIDTH="100%">
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1>
<a href="#"><img src="../images/menu_08_1.gif" border="0"></a></TD>
</TR>
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1> <a href="#"><img src="../images/menu_08_2.gif" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1> <a href="#"><img src="../images/menu_08_3.gif" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1> <a href="#"><img src="../images/menu_08_4.gif" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1> <a href="#"><img src="../images/menu_08_5.gif" width="151" height="25" border="0"></a></TD>
</TR>
</TABLE>
</span> </td>
</tr>
<TR>
<TD xonclick="showhide(3);" onmouseover="show(3);" style="CURSOR: hand">
<IMG name=bar3 src="+.gif" border=0 width=1 height=1>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','../images/menu_06X.gif',1)">
<img src="../images/menu_06.gif" name="Image14" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD xonclick="showhide(4);" onmouseover="show(4);" style="CURSOR: hand">
<IMG name=bar4 src="+.gif" border=0 width=1 height=1>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','../images/menu_07X.gif',0)">
<img src="../images/menu_07.gif" name="Image15" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD xonclick="showhide(5);" onmouseover="show(5);" style="CURSOR: hand">
<IMG name=bar5 src="+.gif" border=0 width=1 height=1></TD>
</TR>
</table>
</body>
</html>
<head>
<title>http://perlbbs.com 초보자를 위한 펄 CGI 프로그램 및 자료실</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<style type="text/css">
<!--
body {font-family: "고딕", "Helvetica", "sans-serif"; font-size: 10px; xline-height:150%; color: #000000}
table {font-family: "고딕", "Helvetica", "sans-serif"; font-size: 10px; xline-height:100%; color: #000000}
A:link { text-decoration: none; color:#333333}
a:visited { color: #333333; text-decoration: none}
a:hover { color: blue; text-decoration: underline} -->
</style>
<script language="javascript">
<!--
var main_cnt = 6
function showhide(num) {
for (i=1; i<=main_cnt; i++) {
menu=eval("document.all.block"+i+".style");
imgch=eval("document.bar"+i);
if (num==i) {
if (menu.display=="block") {
menu.display="none";
imgch.src="+.gif";
}else {
menu.display="block";
imgch.src="-.gif";
}
//}else {
// menu.display="none";
// imgch.src="+.gif";
}
}
}
function show(num) {
for (i=1; i<=main_cnt; i++) {
menu=eval("document.all.block"+i+".style");
imgch=eval("document.bar"+i);
if (num==i) {
menu.display="block";
imgch.src="-.gif";
}else {
menu.display="none";
imgch.src="+.gif";
}
}
}
//-->
</script>
</HEAD>
<BODY onLoad="MM_preloadImages('../images/menu_02X.gif','../images/menu_08X.gif','+ '+ '../images/menu_06X.gif')">
<SCRIPT language="JavaScript">
document.cookie.expires="0";
</SCRIPT>
<TABLE borderColor=white cellSpacing=0 cellPadding=0 width=155 border=0>
<TR>
<TD style="CURSOR: hand" onmouseover="show(1);" xonclick="showhide(1);">
<IMG name=bar1 src="+.gif" border=0 width=1 height=1><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','../images/menu_02X.gif',1)">
<img src="../images/menu_02.gif" name="Image7" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD> <SPAN id=block1 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand"></span></td>
</tr>
<TR>
<TD xonclick="showhide(2);" onmouseover="show(2);" style="CURSOR: hand">
<IMG name=bar2 src="+.gif" border=0 width=1 height=1><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','../images/menu_08X.gif',1)">
<img src="../images/menu_08.gif" name="Image8" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD> <SPAN id=block2 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand">
<TABLE cellSpacing=0 cellPadding=0 border=0 WIDTH="100%">
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1>
<a href="#"><img src="../images/menu_08_1.gif" border="0"></a></TD>
</TR>
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1> <a href="#"><img src="../images/menu_08_2.gif" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1> <a href="#"><img src="../images/menu_08_3.gif" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1> <a href="#"><img src="../images/menu_08_4.gif" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD><IMG src="+.gif" border=0 width=1 height=1> <a href="#"><img src="../images/menu_08_5.gif" width="151" height="25" border="0"></a></TD>
</TR>
</TABLE>
</span> </td>
</tr>
<TR>
<TD xonclick="showhide(3);" onmouseover="show(3);" style="CURSOR: hand">
<IMG name=bar3 src="+.gif" border=0 width=1 height=1>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','../images/menu_06X.gif',1)">
<img src="../images/menu_06.gif" name="Image14" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD xonclick="showhide(4);" onmouseover="show(4);" style="CURSOR: hand">
<IMG name=bar4 src="+.gif" border=0 width=1 height=1>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','../images/menu_07X.gif',0)">
<img src="../images/menu_07.gif" name="Image15" width="151" height="25" border="0"></a></TD>
</TR>
<TR>
<TD xonclick="showhide(5);" onmouseover="show(5);" style="CURSOR: hand">
<IMG name=bar5 src="+.gif" border=0 width=1 height=1></TD>
</TR>
</table>
</body>
</html>
이부분이 문제군요 지금 마우스 오버시에 루핑을 돌면서 block1~2 등의 레이어를 검색하는데 block1, block2 까지만 잇고 3부터는 없는데 전역변수인 main_cnt 에는 6까지 있다고 되어있어서 생기는 문제입니다.
간단하게
var main_cnt = 2;
로 고쳐 주시면 에러는 없어지죠..