|
Java学習者論坛
我有一个JS文件为/js/calendar.js,想在JSP调用其显示出来,老提示:
网页錯误詳细信息
用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; http://bsalsa.com) ; User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; http://bsalsa.com) ( EmbeddedWB http://bsalsa.com/))
時间戳: Wed, 22 Jul 2009 22:24:47 UTC
消息: 'atCalendarControl' 未定义
行: 20
字符: 1
代碼: 0
URI: http://localhost:8080/tyx/jx/test.jsp
消息: 'CalendarWebControl' 為空或不是对象
行: 25
字符: 1
代码: 0
URI: http://localhost:8080/tyx/jx/test.jsp
JSP的文件为:
<%@page contentType="text/HTML; charset=GBK" %>
<%@page session="true" %>
<%@page language="java" %>
<%@page import="java.util.Calendar"%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script type="text/javascript" src="../js/calendar.js" defer="defer"></script>
<title>本地测试網页 </title>
</head>
<%
int currYear = Calendar.getInstance().get(Calendar.YEAR );
int currMonth = Calendar.getInstance().get(Calendar.MONTH)+1;
int currDate = Calendar.getInstance().get(Calendar.DATE );
String CurrentDate = currYear + "-" + currMonth + "-" + currDate;
%>
日歷控件测试 <body>
<script type="text/javascript" src="../js/calendar.js" defer="defer"></script>
<script>
var CalendarWebControl = new atCalendarControl();
</script>
<form name="form1" method="post" action="">
<label>输入日期: </label>
<input name="dateInput" type="text" id="dateInput" size="12" maxlength="12" readonly="1" />
</form>
<label></label>
<input name="dateInput" type="text" id="dateInput" size="12" maxlength="12" readonly="1" value="<%=CurrentDate%>" onClick="CalendarWebControl.show(this,this.value);" />
</body>
</html>
麻煩各位能幫忙解决下,js这塊不是很熟悉,多谢!
欢迎来到Java学习者论壇,转载請注明地址:http://www.javaxxz.com. |
|