由於最近公司要寫一個項目前臺因此開始學習extjs前端框架,但願一塊兒共勉。
那麼咱們的教程就從 Hello World 講起。
helloWorld.js
Ext.onReady(function() {javascript
Ext.MessageBox.alert('系統提示', 'Hello World!');php
});css
helloWorld.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" %>html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">前端
<html>java
<head>bootstrap
<%前端框架
String path = request.getContextPath();框架
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";jsp
%>
<title>hello Word</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<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">
<!-- 引入ExtJs樣式 -->
<link rel="stylesheet" type="text/css" href="<%=basePath %>static/ext-6.0.0.415/build/classic/theme-neptune/resources/theme-neptune-all.css">
<!-- 引入ExtJs核心Js -->
<script type="text/javascript" src="<%=basePath %>static/ext-6.0.0.415/ext-bootstrap.js"></script>
<script type="text/javascript" src="<%=basePath %>static/ext-6.0.0.415/build/ext-all.js"></script>
<script type="text/javascript" src="<%=basePath %>static/ext-6.0.0.415/build/classic/locale/locale-zh_CN.js"></script>
<!-- 頁面Js -->
<script type="text/javascript" src="<%=basePath %>static/js/helloWord.js"></script>
</head>
<body>
</body>
</html>
說明:
(1)Ext.onReady():ExtJS Application的入口...就至關於Java或C#的main函數.
(2)Ext.MessageBox.alert():彈出對話框。
轉載於猿2048:⇒《extjs 6》