关于VBscript脚本语言的ASP编程?

来源:百度知道 编辑:UC知道 时间:2024/05/21 20:59:11
请问下面的语句
response.Write "document.location=""4-10.html""" & vbcrlf

为什么不能写成
response.Write "document.location="4-10.html"" & vbcrlf

也就是说为什么 4-10.html 前后要加上两个引号??
在ASP编程情况下类似
document.location=""4-10.html""
的语句必须用两对引号,什么情况下可以用一对引号??

response.Write "document.location=""4-10.html""" & vbcrlf

"& vbcrlf 是一个整体
代表回车换行
语法问题

你需要在前面加" 所以
少个"就是错的

asp里要输出"
就要多加个""
当然你也可以这样
response.Write "document.location='4-10.html'" & vbcrlf

引号和引号是成对的
因为VB表示字符就是用"双引号
所以有用单引号的地方就要再加一个单引号
这可能有点挠口
document.location=""4-10.html""
像这样的话,肯定是错误的
必须是
document.location="'4-10.html'"

asp中引用内容输出,两个双引号当一个用,你这个可以直接写成response.redirect("4-10.html")