ExtJS的问题,希望解答。
发布网友
发布时间:2022-04-28 15:23
我来回答
共2个回答
热心网友
时间:2022-04-24 20:23
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<html>
<head>
<title>P</title>
<%
String root = request.getContextPath();
%>
<link rel="stylesheet" type="text/css"
href="<%=root%>/pages/extjs2.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css"
href="<%=root%>/pages/extjs2.0/extensions/PasswordMeter/passwordmeter.css" />
<link rel="stylesheet" type="text/css"
href="<%=root%>/pages/extjs2.0/resources/css/xtheme-silverCherry.css" />
<link rel="stylesheet" type="text/css"
href="<%=root%>/pages/css/style.css" />
<script type="text/javascript"
src="<%=root%>/pages/extjs2.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript"
src="<%=root%>/pages/extjs2.0/ext-all.js"></script>
<script type="text/javascript"
src="<%=root%>/pages/js/ext-customized.js"></script>
<script type="text/javascript"
src="<%=root%>/pages/extjs2.0/extensions/PasswordMeter/Ext.ux.PasswordMeter.js"></script>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function(){
// Ext.BLANK_IMAGE_URL = '<%=root%>/pages/extjs2.0/resources/images/default/s.gif';
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'under';
var loginForm = new Ext.form.FormPanel({
clientValidation:true,//进行客户端验证
title:'用户登陆',
labelWidth:50,
width:330,
height:150,
frame:true,
labelSeparator:':',
labelAlign:"left",
applyTo:'loginForm',
keys:[{
key: [10,13],
fn:login
}],
items:[
new Ext.form.TextField({
fieldLabel:'用户名',
name:'loginName',
inputType:'text',
width:150,
allowBlank:false,
blankText:'请输入',
value:'admin'
}),
new Ext.form.TextField({
fieldLabel:'密 码',
name:'password',
inputType:'password',
width:150,
allowBlank:false,
blankText:'请输入',
value:'admin'
})
],
buttons:[
new Ext.Button({
text:' 登 陆 ',
handler:login
}),
new Ext.Button({
text:' 重 置 ',
handler:reset
})
]
})
function login(){
loginForm.form.submit({
clientValidation:true,//进行客户端验证
waitMsg:'正在登录系统请稍后',//提示信息
waitTitle:'提示',//标题
url:'Login.action',
method:'GET',//请求方式
success:function(form,action){
Ext.Msg.alert('提示','系统成功登陆');
document.location="<%=root%>/pages/user/main.jsp";
},
failure:function(form,action){
if(action.result==undefined){
return;
}
Ext.Msg.alert('提示','系统登录失败,原因:' + action.result.msg);
}
})
}
function reset(){
loginForm.form.reset();
}
});
</script>
<table border="0">
<tr>
<td align="center" colspan="4">
</td>
</tr>
<tr>
<td rowspan="5" width=20%>
</td>
</tr>
<tr>
<td rowspan="5" >
<table>
<tr>
<td>
<div align="center" class="titleText24px">
</div>
<div align="center" class="smallText">
</div>
</td>
<tr>
<td width="700" align="center" height="500"
>
<div id="loginForm" align="center"></div>
</td>
<td>
</td>
</tr>
<tr>
<td>
<div align="center">
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td rowspan="5" width=5%>
</td>
</tr>
</table>
</html>
热心网友
时间:2022-04-24 21:41
Syntax error 通常都是你页面拼写有错误,你看看是不是什么分号,括号少了或者多了