我这个js写的对吗,

wyj518 2010-05-20 03:01:39
<script type="text/javascript" language="javascript">
<!--
function switchstatus(obj){
if (document.getElementById(obj).style.display="none"){
document.getElementById(obj).style.display="block";

}else{
document.getElementById(obj).style.display="none";

}
}
//-->
</script>
我这个js写的对吗,运行的时候 总是点击按钮第一次是是对的,第二次点击不对了 如何改啊
...全文
105 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
xjthsl 2010-05-20
  • 打赏
  • 举报
回复
回12楼,我这代码是以前同事写的,现在需要修改。
chengji0401 2010-05-20
  • 打赏
  • 举报
回复
1楼正解!鉴定完毕!
gsq_0912 2010-05-20
  • 打赏
  • 举报
回复
11楼的,牛B!!!
xjthsl 2010-05-20
  • 打赏
  • 举报
回复
我分不多,想借宝地请教一个问题:
if RadioGroup1.value=="1" then {
if request("flag")="send" then
strDate = request("d")
if not isdate(strDate) then Response.Write "<font color=red>请先选择日期!</font>" : Response.End
nowDT = cdate(strDate)
strNow=cstr(year(nowDT))
iMonth=month(nowDT)
if iMonth<10 then strNow=strNow & cstr(0)
strNow=strNow & cstr(iMonth)
iDay=day(nowDT)
if iDay<10 then strNow=strNow & cstr(0)
strNow=strNow & cstr(iDay)
set fso=server.CreateObject("Scripting.FileSystemObject")
if fso.FileExists(server.MapPath("jcfiles\" & strNow & ".xls")) then
Response.Write "<a href=jcfiles/" & strNow & ".xls" & " target=_blank><b>甲醇生产日报" & strDate & "</b></a>"
else
Response.Write "<font color=red>甲醇生产日报" & strDate & "不存在!</font>"
end if
end if
}
else if RadioGroup1.value=="2" then
{
if request("flag")="send" then
strDate = request("d")
if not isdate(strDate) then Response.Write "<font color=red>请先选择日期!</font>" : Response.End
nowDT = cdate(strDate)
strNow=cstr(year(nowDT))
iMonth=month(nowDT)
if iMonth<10 then strNow=strNow & cstr(0)
strNow=strNow & cstr(iMonth)
iDay=day(nowDT)
if iDay<10 then strNow=strNow & cstr(0)
strNow=strNow & cstr(iDay)
set fso=server.CreateObject("Scripting.FileSystemObject")
if fso.FileExists(server.MapPath("files\" & strNow & ".xls")) then
Response.Write "<a href=files/" & strNow & ".xls" & " target=_blank><b>原稳生产日报" & strDate & "</b></a>"
else
Response.Write "<font color=red>原稳生产日报" & strDate & "不存在!</font>"
end if
end if
}
end if

想借用一组单选按钮,根据选中不同的单选按钮,进行相应的读取文件操作,但总报错,请会的朋友指点一下,本来有4个单选钮组成,这里写了2个。
hibin101 2010-05-20
  • 打赏
  • 举报
回复
呵呵,我也经常犯这错误,判断喜欢用=号
happy002 2010-05-20
  • 打赏
  • 举报
回复
我刚开始写程序的时候也总犯这个错误
绿光 2010-05-20
  • 打赏
  • 举报
回复
1楼对了
zhentamadenanqi 2010-05-20
  • 打赏
  • 举报
回复
楼上的都比我厉害~~我看了第二眼才看出来的!
lin992 2010-05-20
  • 打赏
  • 举报
回复
厉害。一看就中
andensy 2010-05-20
  • 打赏
  • 举报
回复
if中是判断要用==
O(∩_∩)O哈哈~ LZ这是犯糊涂了
passself 2010-05-20
  • 打赏
  • 举报
回复
if中是判断要用==
passself 2010-05-20
  • 打赏
  • 举报
回复
if中是判读要用==
zxcvbnmluton 2010-05-20
  • 打赏
  • 举报
回复
厉害。一看就中
qq43695548 2010-05-20
  • 打赏
  • 举报
回复
if (document.getElementById(obj).style.display=="none")

87,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧