日期:2014-05-18  浏览次数:20714 次

请问以下程序有什么错吗?
<%@ page contentType="text/html; charset=GBK" import="java.util.*"%>
 <%! int index=0; %>
<html>
<head>
<title>
marqueeJsp
</title>
</head>
<body bgcolor="#ffffff">
  <%
  Random objrand=new Random();
  index=objrand.nextInt(10);
  %>
 <marquee direction=up behavior=alternate loop=-1
  height=100% scrollamount=2 scrolldelay=1 border="0"
  vspace=1 align=left hspace=15>
  <img src="pictures/b"+<%=index%>+".jpg" width=200 height=300>
  你好吗?
  </marquee>
<p>What are you doing?</p>
</body>
</html>


------解决方案--------------------
没看出来错
------解决方案--------------------
<%@ page contentType="text/html; charset=GBK" import="java.util.*"% > //右边>前多一个空格
<%! int index=0; % >//右边>前多一个空格
<html >//右边>前多一个空格
<head >//右边>前多一个空格
<title >//右边>前多一个空格
marqueeJsp
</title >//右边>前多一个空格
</head >//右边>前多一个空格
<body bgcolor="#ffffff" >//右边>前多一个空格
<%
Random objrand=new Random();
index=objrand.nextInt(10); //这里是大错误,Random不是这样用的啦,要达到从1.jpg到10.jpg的随机的话
% >//右边>前多一个空格
<marquee direction=up behavior=alternate loop=-1
height=100% scrollamount=2 scrolldelay=1 border="0"
vspace=1 align=left hspace=15 >
<img src="pictures/b"+ <%=index% >+".jpg" width=200 height=300 >//右边>前多一个空格 
//另外src的组合有错误
你好吗?
</marquee >//右边>前多一个空格
<p >//右边>前多一个空格What are you doing? </p >//右边>前多一个空格
</body >//右边>前多一个空格
</html > //右边>前多一个空格
修改好的代码请稍好