为了账号安全,请及时绑定邮箱和手机立即绑定

这里有一个是关于VBScript的疑问,请问该怎么解决?

这里有一个是关于VBScript的疑问,请问该怎么解决?

慕容708150 2021-07-20 19:15:48
<html><head><script type="text/vbscript">function greeting()i=hour(time)if i < 10 thendocument/write("Good morning!")elsedocument/write("Have a nice day!")end ifend function</script></head><body><script type="text/vbscript">document.write ("Look at:" & greeting())</script></body></html>为什么显示出来是:Have a nice day! Look at:不是应该是:Look at:Have a nice day! 吗?下面这个就可以按顺序显示<html><head><script type="text/vbscript">function myFunction()myFunction = "蓝色"end function</script></head><body><script type="text/vbscript">document.write("我喜欢的颜色是:" & myFunction())</script></body></html>显示出来就是:我喜欢的颜色是:蓝色并没有倒过来,不明白为什么?
查看完整描述

2 回答

?
慕桂英546537

TA贡献1848条经验 获得超10个赞

在执行“document.write ("Look at:" & greeting())”这句话的时候,括号中的"Look at:" & greeting()被看做是一个表达式,表达式中含有函数,系统在显示这个表达式之前,去执行了函数。
也就是首先显示了greeting()函数中的内容,执行完函数后由于函数没有返回值,于是就写了一个Look at:。

查看完整回答
反对 回复 2021-07-25
?
慕莱坞森

TA贡献1810条经验 获得超4个赞

改成这样就可以了:
if s = mm then
alert("密码正确")
else
alert("密码错误,请重输")
end if
另外,你的源代码中落下一个loop.

查看完整回答
反对 回复 2021-07-25
  • 2 回答
  • 0 关注
  • 306 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信