日期:2014-05-17  浏览次数:20844 次

请高手看看这两段程序有什么不同 重分想谢
我是个菜鸟   请大家指点为什么   详细点谢谢了

1           (1.htm)     返回str     i1-1-9-10
<HTML>
<HEAD>

<SCRIPT     LANGUAGE=vbscript>


Dim   str  
dim   str3  
Dim   Intstr1
dim   Intstr2  
        str   =   "c:\windows\i1-1-1-9-10-1.jpg "
        Intstr1   =   InStrRev(str,   "- ")
        Intstr2   =   InStrRev(str,   "\ ")
        str3   =   Mid(str,   (Intstr2   +   1),   (Intstr1   -   Intstr2   -   1))
        msgbox   str3

</SCRIPT>
</HEAD>
<BODY>

</BODY>
</HTML>

2:         2.htm     没返回内容
<%@LANGUAGE= "VBSCRIPT "   CODEPAGE= "936 "%>
<%

Dim   str  
dim   str3  
Dim   Intstr1
dim   Intstr2  
        str   =   "c:\windows\i1-1-1-9-10-1.jpg "
        Intstr1   =   InStrRev(str,   "- ")
        Intstr2   =   InStrRev(str,   "\ ")
        str3   =   Mid(str,   (Intstr2   +   1),   (Intstr1   -   Intstr2   -   1))
        response.write   str3  
%>
<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
</head>
<body>
</body>
</html>




------解决方案--------------------
经我的测试结果是:完全一样i1-1-1-9-10
没有结果说明你的服务器不支持asp脚本,二就是你的背景颜色和字体颜色一样了
------解决方案--------------------
response.write str3
改成 alert(str3) 看一下.
------解决方案--------------------
打印在body中看看
------解决方案--------------------
第一段是客户端脚本
第二段是服务器端脚本
------解决方案--------------------
你不觉得你2.htm代码写的有问题吗
怎么会把脚本写在
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
上面?
还有1.htm是用msgbox弹出对话框来输出的。。。。
而2.htm是使用response.write 输出。。输出方法也不一样
还有1.htm是客户端脚本,2.htm是服务器端脚本