什么用法?
本帖最后由 javaweb_coder 于 2013-10-28 23:04:02 编辑
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!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=GBK">
<title>登录</title>
<script src="js/jquery-1.7.1.js" type="text/javascript" charset="GBK"></script>
<script>
var query = location.search.substring(1); // Get query string
if(query == 'usernull=yes'){
top.window.location.href = '/CPS/login.jsp';
}
if (window != top){
top.window.location.href = location.href;
location.reload(true);
}
$(document).ready(function(){
var bro=$.browser;
var binfo="";
if(bro.msie) {binfo="Microsoft Internet Explorer "+bro.version;}
if(bro.mozilla) {binfo="Mozilla Firefox "+bro.version;}
if(bro.safari) {binfo="Apple Safari "+bro.version;}
if(bro.opera) {binfo="Opera "+bro.version;}
alert('您使用的浏览器版本是:'+binfo+'\n\n为了保证显示效果及脚本正常运行,请使用火狐10.0以上或IE9以上版本');
$('#userPwd').focus();
$('#userName').focus().blur().focus();
$('#userPwd').bind('keydown',function(e){
var key = e.which;
if(key == 13){
Login.loginSubmit();
}
});
});
var Login = new function(){
this.loginSubmit = function(){
$.ajax({
type: "POST",
url:"/CPS/loginAction.do",
data:encodeURI($('#loginForm').serialize()),
dataType:"json",
async: false,