vbscript中回车换行问题

来源:百度知道 编辑:UC知道 时间:2024/06/16 09:33:35
下面是一段关于输出的两个数据能够出现回车换行代码
<script language="vbscript">
first1=InStrB("This is a test","T")
first2=InStrB("This is a test","t")
msgbox first1&vbcrlf&first2
</script>
而把“msgbox first1&vbcrlf&first2”这句改为
document.write first1&vbcrlf&first2运行输出显示两个数据只出现空格而不能回车换行呢?如果用这种方式输出怎么能够出现回车换行呢?

msgbox是函数,vbcrlf只对VBS有用~如果document.write first1&vbcrlf&first2的话,
网页显示的是三个变量连接后的值~write是写进html里面的,所以你想换行,得用html的换行
<br>才是换行,所以应该是:
document.write first1&"<br>"&first2
1楼的也对,不知道2楼在说什么

document.write first1&"<br />"&first2

楼上的我试过不行,运行显示空白。"<br />"两边加引号是在ASP文件中作为字符串输出的回车换行符,而在VB脚本中不能使用