这个jsp文件为什么不行

作者在 2010-12-24 10:09:39 发布以下内容
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script language="javascript" type="text/javascript"
    src="include/contain.js">
    $(document).ready(function() {
    var currentDate = new Date();
    var currentYear = currentDate.getFullYear();
    var lastYear = currentYear - 1;
    var nextYear = currentYear + 1;
    var options = '<option value="' + lastYear + '">' + lastYear + '</option>' +
                  '<option selected="selected" value="' + currentYear + '">' + currentYear + '</option>' +
                  '<option value="' + nextYear + '">' + nextYear + '</option>'
    $('#projectYear').append(options);
    )
});
</script>
</head>
<body>
<select id="projectYear" class="width70n"> </select>
</body>
</html>
默认分类 | 阅读 729 次
文章评论,共1条
angelnana(作者)
2010-12-24 10:15
1
&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=ISO-8859-1&quot;<br />
&nbsp; &nbsp; pageEncoding=&quot;ISO-8859-1&quot;%&gt;<br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/html4/loose.dtd&quot;&gt;" target="_blank">http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</a><br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;&gt;<br />
&lt;title&gt;Insert title here&lt;/title&gt;<br />
&lt;script src=&quot;include/jquery-1.4.4.js&quot;&gt;&lt;/script&gt;<br />
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; src=&quot;include/contain.js&quot;&gt;<br />
&nbsp; &nbsp; $(document).ready(function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; var currentDate = new Date();<br />
&nbsp; &nbsp; &nbsp; &nbsp; var currentYear = currentDate.getFullYear();<br />
&nbsp; &nbsp; &nbsp; &nbsp; alert(currentYear);<br />
&nbsp; &nbsp; &nbsp; &nbsp; var lastYear = currentYear - 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; var nextYear = currentYear + 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; var options = '&lt;option value=&quot;' + lastYear + '&quot;&gt;' + lastYear + '&lt;/option&gt;' +<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;'&lt;option selected=&quot;selected&quot; value=&quot;' + currentYear + '&quot;&gt;' + currentYear + '&lt;/option&gt;' +<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;'&lt;option value=&quot;' + nextYear + '&quot;&gt;' + nextYear + '&lt;/option&gt;'<br />
&nbsp; &nbsp; &nbsp; &nbsp; $('#projectYear').append(options);<br />
&nbsp; &nbsp; &nbsp; &nbsp; )<br />
});<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;select id=&quot;projectYear&quot; class=&quot;width70n&quot;&gt; &lt;/select&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
还是不行,你复制过去跑跑看~~
游客请输入验证码