菜鸟的问题,IF语句,语法不对!请帮我!

gross1215 2003-07-05 01:54:16
<script language="javascript">
if (parseInt(document.forms[0].txtbright.value) < 129) and (parseInt(document.forms[0].txtbright.value) > 1) and
(parseInt(document.forms[0].txtcontrast.value) < 129) and (parseInt(document.forms[0].txtcontrast.value) > 1) and
(parseInt(document.forms[0].txthue.value) < 129) and (parseInt(document.forms[0].txthue.value) > 1)
{
document.all("xplug").SetImageConfig(-1,-1,-1,document.forms[0].txtbright.value,document.forms[0].txtcontrast.value,document.forms[0].txthue.value,-1);
}
<script>
这句话为什么不对!IF语法不错误吗???
...全文
32 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwsh 2003-07-05
  • 打赏
  • 举报
回复
up
wssgwps 2003-07-05
  • 打赏
  • 举报
回复
vbscript才用 and,javascript用 && !
tommypage 2003-07-05
  • 打赏
  • 举报
回复
if 语言中的“与”和“或”是用"&&" 和"||" 来实现的
wjcking 2003-07-05
  • 打赏
  • 举报
回复
这不是basic
Jaron 2003-07-05
  • 打赏
  • 举报
回复
if ((parseInt(document.forms[0].txtbright.value) < 129) and (parseInt(document.forms[0].txtbright.value) > 1) &&
(parseInt(document.forms[0].txtcontrast.value) < 129) and (parseInt(document.forms[0].txtcontrast.value) > 1) &&
(parseInt(document.forms[0].txthue.value) < 129) and (parseInt(document.forms[0].txthue.value) > 1)){

....
}
Surpass3000 2003-07-05
  • 打赏
  • 举报
回复
回菜鸟:
if ((parseInt(document.forms[0].txtbright.value) < 129) & (parseInt(document.forms[0].txtbright.value) > 1) &
(parseInt(document.forms[0].txtcontrast.value) < 129) & (parseInt(document.forms[0].txtcontrast.value) > 1) & (parseInt(document.forms[0].txthue.value) < 129) & (parseInt(document.forms[0].txthue.value) > 1))
{
}

原理:
if ((?) & (?) & (?))
{
}
sw47 2003-07-05
  • 打赏
  • 举报
回复
and用&&替换

87,988

社区成员

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

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