六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 161|回复: 0

我的第一个程序------有点曲折

[复制链接]

升级  8.67%

66

主题

66

主题

66

主题

举人

Rank: 3Rank: 3

积分
226
 楼主| 发表于 2013-2-7 22:29:56 | 显示全部楼层 |阅读模式
以前就看到Extjs那特别炫的效果,那时候就很想弄它,可那时有其它的事要做,最近有点时间了,就想来弄下它!先到它的官网上看了教程,开始了自己的第一个Ext程序,可没想到第一个就出错了,以前下了个3.0的版本,所以刚开始的时候就是用3.0来实现的!写了个简单的Hello World程序,在firefox中运行的时候就提示EXT不存在,花了我一点时间才找到原因,原来是我把Ext写成EXT了!呵呵!
<html> <head>  <title> New Document </title>  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  <meta name="Generator" content="EditPlus">  <meta name="Author" content="">  <meta name="Keywords" content="">  <meta name="Description" content="">  <link ref="stylesheet" type="text/css" href="ext-all.css">  <script type="text/javascript" src="ext-base.js"></script>  <script type="text/javascript" src="ext-all-debug.js"></script>  <script type="text/javascript">Ext.onReady(function() {alert("hello world!");});  </script> </head> <body>   </body></html> 
3版本需要加3xt-base.js和ext-all(-debug).js,而且它们的顺序还不能乱;而四版本的话只需要加一个ext-all(-debug).js就可以了 ;
 
在浏览官网的时候看到最新版本是4.0了就下了个4.0版本,以后应该都会用4.0版本了。4.0版本的Hello World程序代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%><%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>index</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="styles.css">--><script type="text/javascript" src="ext4/ext-all-debug.js"></script><script type="text/javascript">Ext.onReady(function() {alert("hello world!");});</script>  </head>    <body>    This is my JSP page. <br>  </body></html> 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表