ct is null

<%@ 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 'MyGrid.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="/extjs/resources/css/ext-all.css" />
	 <script type="text/javascript" src="/extjs/adapter/ext/ext-base.js"></script> 
	 <!-- 引用Ext JS 的框架文件 -->
	 <script type="text/javascript" src="/extjs/ext-all.js"></script>
	<script type="text/javascript" src="/extjs/ext-all-debug.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
 <body>
<script type="text/javascript">
var store = new Ext.data.Store();
var cm = new Ext.grid.ColumnModel
([
	{
		header : 'username',
		dataIndex : 'USERNAME',
		width : 200
	},{
		header : 'password',
		dataIndex : 'PASSWORD'
	}
]);

var myGridPanel = new Ext.grid.GridPanel
({
	store : store,
	cm : cm	
});
myGridPanel.render('mygrid');
</script>
[b]<div id="mygrid"></div>[/b]
</body>
</html>


以上代码会报 ct is null的错误,但是,如果把<div id="mygrid"></div>代码放到body中<script>的前面,就正常显示,难道加载的时候,extjs只会找之前的,之后的不会找?,确实属于加载顺序的问题

你可能感兴趣的:(JavaScript,html,ext)