这段代码有什么错,我实在看不出 在OnMouseUp='turnIt(layer2073,img2073,indent2073);'img2073是id而你是要将这个对象传进来。用document.all.item("img2073")代替img2073试试。此外代码中有关于这样的都作同样的处理。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 根据你的意思,我把JS代码改成:<script language="javascript"><!--function turnIt(layer,img,indent){ if (document.all.item(layer).style.display=="none") { document.all.item(layer).style.display = "block"; document.all.item(indent).style.display = "block"; document.all.item(img).src = "minus.gif"; else { document.all.item(layer).style.display = "none"; document.all.item(indent).style.display = "none"; document.all.item(img).src = "plus.gif"; }}function turnOut(content){ document.all.item(content).style.display = document.all.item(content).style.display=="none"?"block":"none";}//--></script>好象还是不行。 函数调用的参数要加引号,比如说:turnIt(layer2073,img2073,indent2073);改成turnIt("layer2073","img2073","indent2073"); <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><script language="javascript">//<!--function turnIt(layer,img1,indent){ if (layer.style.display=="none") { layer.style.display = ""; indent.style.display = ""; img1.src = "minus.gif"; } else { layer.style.display = "none"; indent.style.display = "none"; img1.src = "plus.gif"; }}function turnOut(content){ content.style.display = content.style.display=="none"?"":"none";}</script><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><Title>BBS Using M$ SQL Server 2000</Title></Head><Body><table border="0"> <tr> <td language='JavaScript' OnMouseUp='turnIt(layer2073,img2073,indent2073);' style='CURSOR:hand'> <img id=img2073 src='plus.gif' width='9' height='9'> </td> <td id=title2073 language='JavaScript' OnMouseUp='turnOut(content2073);' style='CURSOR:hand'> 为什么诺顿杀毒那么慢啊! </td> </tr> <tr> <td colspan=2 id=content2073 style='DISPLAY:none'> <table boder='0' bgcolor='grey'> <tr><td></td> <td> 为什么诺顿杀毒那么慢啊!<BR>我的是WIN-XP,为了内存和速度只好用这个啊! </td> </tr> </table> </td> </tr> <tr> <td id=indent2073 style='DISPLAY:none'> </td> <td id=layer2073 style='DISPLAY:none'> <table border='0'> <tr> <td> <img id=img4048 src='minus.gif' width='9' hight='9'> </td> <td id=title4048 language='JavaScript' OnMouseUp='turnOut(content4048);'Style='CURSOR:hand'> Re:为什么诺顿杀毒那么慢啊! </td> </tr> <tr> <td colspan=2 id=content4048 style='DISPLAY:none'> <table boder='0' bgcolor='grey'> <tr><td></td> <td> 是的,诺顿杀毒是慢,不过驻留占用较少,查毒好,还是优选的一种杀毒软件 </td> </tr> </table> </td> </tr> </table> <table border='0'> <tr> <td> <img id=img4049 src='minus.gif' width='9' hight='9'> </td> <td id=title4049 language='JavaScript' OnMouseUp='turnOut(content4049);'Style='CURSOR:hand'> Re:为什么诺顿杀毒那么慢啊! </td> </tr> <tr> <td colspan=2 id=content4049 style='DISPLAY:none'> <table boder='0' bgcolor='grey'> <tr><td></td> <td> 普通用户还是不要用xp了,太浪费资源 </td> </tr> </table> </td> </tr> </table> </td> </tr></table></Body></Html> 缺少一个 }变量img写成其他得名字 关于计算器问题 各位帮忙啊 求一个可以检测JavaScript圈复杂度的工具!!!!!!! 通过window.open打开的窗口想得到父窗口的URL 如何把ie自身的滚动条不显示,而显示iframe包含页的滚动条?50分求急~ 新手变量问题 问个菜鸟问题,关于Ext中的动态定义变量的问题! 问个正则表达式的问题 做过搜索引擎的都过来啊! 关于搜索引擎,已能高速 获取第一关键字id 求救怎么再次检索(既合并关键字)! 世界地图! 一个实在简单的问题! 【新手虚心请教各位大侠】关于在页面中加入.JS,以实现浮动广告 高分求js連sql的代碼范例!急!,在線等。
<!--
function turnIt(layer,img,indent)
{
if (document.all.item(layer).style.display=="none") {
document.all.item(layer).style.display = "block";
document.all.item(indent).style.display = "block";
document.all.item(img).src = "minus.gif";
else {
document.all.item(layer).style.display = "none";
document.all.item(indent).style.display = "none";
document.all.item(img).src = "plus.gif";
}
}function turnOut(content)
{
document.all.item(content).style.display = document.all.item(content).style.display=="none"?"block":"none";
}
//-->
</script>好象还是不行。
turnIt(layer2073,img2073,indent2073);
改成
turnIt("layer2073","img2073","indent2073");
<html>
<head><script language="javascript">
//<!--
function turnIt(layer,img1,indent)
{
if (layer.style.display=="none") {
layer.style.display = "";
indent.style.display = "";
img1.src = "minus.gif";
}
else {
layer.style.display = "none";
indent.style.display = "none";
img1.src = "plus.gif";
}
}function turnOut(content)
{
content.style.display = content.style.display=="none"?"":"none";
}</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<Title>BBS Using M$ SQL Server 2000</Title>
</Head>
<Body>
<table border="0">
<tr>
<td language='JavaScript' OnMouseUp='turnIt(layer2073,img2073,indent2073);' style='CURSOR:hand'>
<img id=img2073 src='plus.gif' width='9' height='9'>
</td>
<td id=title2073 language='JavaScript' OnMouseUp='turnOut(content2073);' style='CURSOR:hand'>
为什么诺顿杀毒那么慢啊!
</td>
</tr>
<tr>
<td colspan=2 id=content2073 style='DISPLAY:none'>
<table boder='0' bgcolor='grey'>
<tr>
<td>
</td>
<td>
为什么诺顿杀毒那么慢啊!<BR>我的是WIN-XP,为了内存和速度只好用这个啊!
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id=indent2073 style='DISPLAY:none'>
</td>
<td id=layer2073 style='DISPLAY:none'>
<table border='0'>
<tr>
<td>
<img id=img4048 src='minus.gif' width='9' hight='9'>
</td>
<td id=title4048 language='JavaScript' OnMouseUp='turnOut(content4048);'Style='CURSOR:hand'>
Re:为什么诺顿杀毒那么慢啊!
</td>
</tr>
<tr>
<td colspan=2 id=content4048 style='DISPLAY:none'>
<table boder='0' bgcolor='grey'>
<tr>
<td>
</td>
<td>
是的,诺顿杀毒是慢,不过驻留占用较少,查毒好,还是优选的一种杀毒软件
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td>
<img id=img4049 src='minus.gif' width='9' hight='9'>
</td>
<td id=title4049 language='JavaScript' OnMouseUp='turnOut(content4049);'Style='CURSOR:hand'>
Re:为什么诺顿杀毒那么慢啊!
</td>
</tr>
<tr>
<td colspan=2 id=content4049 style='DISPLAY:none'>
<table boder='0' bgcolor='grey'>
<tr>
<td>
</td>
<td>
普通用户还是不要用xp了,太浪费资源
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table></Body>
</Html>
变量img写成其他得名字