(一)ExtJs搭建环境之hello Ext

首先下载ExtJS开发发布包,创建web工程之后,将关键的核心资源拷贝到项目中,主要包括有ext-all.js,adapter/ext/ext-base.js,src/locale/ext-lang-zh_CN.js和整个resources目录(注意:这是目录的名字是带有"s"结尾的,引入的时候千万别错了,笔者就犯了这个错误).还有一个 特别注意的地方,

<script type="text/javascript" src="resource/ext-base.js"></script>一定要导入在<script type="text/javascript" src="resource/ext-all.js"></script>之前,否则将报错.
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <link rel="stylesheet" type="text/css" href="resource/resources/css/ext-all.css"><!--
  <script type="text/javascript" src="resource/ext-base.js"></script>
  <script type="text/javascript" src="resource/ext-all.js"></script>
  <script type="text/javascript" src="resource/ext-lang-zh_CN.js"></script>
    <title>ExtJS 自学历程</title>
    <script >
    	Ext.onReady(function(){
    		Ext.MessageBox.alert('helloworld','hello word.');
    	});
    </script>
  </head>
  <body>
    ExtJS学习的第一页<br>
  </body>
</html>

相关推荐