日期:2014-05-16  浏览次数:20310 次

引用的js脚本,在浏览器里不显示。
    本人正在学习ExtJS框架,按照《learning ExtJS》第三章内容,写了一个formPanel,页面和js脚本是分离的,在MyEclipse中显示正常。但是部署到tomcat后,在浏览器中却不显示,试过很多浏览器,包括TT,360,遨游,IE,firefox,效果都一样,打开页面一篇空白。望指教

代码如下:
main.jsp:(用于用户展示,主页面)
______________________________________________________________________________________
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<%@include file="base.jsp"%>
<script language="javascript" src="js/movie_form.js"/>
</head>
<body>

</body>
</html>
_______________________________________________________________________________________
base.jsp:(用于引入ext框架)

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />
<script src="ext/adapter/ext/ext-base.js"></script>
<script src="ext/ext-all-debug.js"></script>

________________________________________________________________________________________
movie_form.js:(用于创建表单)

Ext.onReady(function() {
Ext.QuickTips.init();

Ext.form.VTypes.wcVal = /^([A-Z]{1})[A-Za-z\-]+ ([A-Z]{1})[A-Za-z\-]+/;
Ext.form.VTypes.wcMask = /[A-Za-z\- ]/;
Ext.form.VTypes.wcText = '不正确的名字!格式:Michael Jackson';
Ext.form.VTypes.wc = function(v) {
return Ext.form.VTypes.wcVal.test(v);
};

var genres = new Ext.data.SimpleStore({
fields:['id','genre'],
data:[['0','new genre'],['1','Comedy'],['2','Drama'],['3','Action']]
});
var movie_form = new Ext.FormPanel({
title : "Movie info Form",
url : "movie_form_summit.jsp",
frame : true,
width : 250,
renderTo : document.body,
items : [{
xtype : "textfield",
fieldLabel : "Title",
name : "title",
allowBlank : false,
listeners:{
specialkey:function(f,e){
if(e.getkey()==e.ENTER)
movie_form.getForm().submit();
}
}
}, {
xtype : "textfield",
fieldLabel : "Director",
name : "director",
vtype : "wc"
}, {
xtype : "datefield",
fieldLabel : "Released",
name : "released",
disabledDays : [0, 6]
}, {
xtype : "radio",
fieldLabel : "Filmed In",
name : "filed_in",
boxLabel : "Color"
}, {
xtype : "radio",
fieldLabel : "",
// hideLabel:true/false,
labelSeparator : "",
name : "filed_in",
boxLabel : "Black & White"
}, {
xtype : "checkbox",
fieldLabel : "Bad Movie",
name : "bad_movie"
},{
xtype:"combo",
name:"genre",
fieldLabel:"Genre",
mode:"local",//remote
store:genres,
displayField:"genre",
width:120,
emptyText:"select genre here",
listeners:{
select : function(f,r,i){
if(i==0){
Ext.Msg.prompt('New Genre','Name',Ext.emptyFn);}
}}
},{
xtype: "htmleditor",
name : "description",
hideLabel :true,
labelSeparator:"",
height:200,
anchor:"100%"
}
],
buttons : [{
text : "Save",
handler : function() {
movie_form.getForm().submit({<