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

extjs缺少分号的问题 - Web 开发 / Ajax
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <base href="<%=basePath%>">
   
  <title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">  
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css">
  <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';
//定义数据集对象
var store = new Ext.data.Store({//配置分组数据集
autoLoad:true,
reader:new Ext.data.JsonReader({
totalRecords:"results",
root:"list",
fields:[
{name:'userId'},
{name:'userName'},
{name:'userPwd'}
]
}),
proxy:new Ext.data.HttpProxy({
url:'showTestUser.action'
})
});
//创建Grid组件
var grid = new Ext.grid.GridPanel({
title:'人员列表',
applyTo:'grid-div',
width:450,
height:200,
frame:true,
store:store,
columns:[//配置表格列
new Ext.grid.RowNumberer(),//表格行号组件
{header:"id",width:80,dataIndex:'userId',sortable:true},
{header:"姓名",width:80,dataIndex:'userName',sortable:true},
{header:"年龄",width:80,dataIndex:'userPwd',sortable:true}
]
});
});
</script>
  </head>
  
  <body>
  <div id="grid-div"></div>
  </body>
</html>

这样写,显示正常,单一把里面的extjs代码单独写到JS文件,然后引用该文件就报缺少;的错误呢?

------解决方案--------------------
语法错误了吧
 建议LZ认真调试下

还有建议你把错误的代码贴出来!