看一个最少需求的HTML页面设置。
Main.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="../ext-2.2/resources/css/ext-all.css"/>
<script type="text/javascript" src="../ext-2.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext-2.2/ext-all-debug.js"></script>
<script type="text/javascript" src="Main.js"></script>
</head>
<body>
</body>
</html>
ext-all.css是ExtJs使用的css文件
ext-base.js是 ExtJs的基本文件
ext-all-debug.js在生产环境中应该由ext-all.js取代
对应的Javascript文件:
Main.js
Ext.BLANK_IMAGE_URL = "../ext-2.2/images/default/s.gif";
Ext.onReady(function(){
alert('I am ready!');
});
其中Ext.BLANK_IMAGE_URL用来指示s.gif的本地路径(Ext uses a 1x1 transparent gif image to create inline icons with CSS background images. The default URL to this file is "extjs.com/s.gif")
如果没有意外,在浏览器中打开Main.html将弹出消息框。