日期:2014-05-17 浏览次数:20771 次
$(function() {
// alert("test");
$("#su").click(
function() {
// alert("test");
if ($("#username").val() != "" && $("#passw").val() != "") {
alert($("#username").val());
alert($("#passw").val());
$.ajax({
url : "user/logintest.action", //"user/logintest.action",
date : {
"username" : $("#username").val(),
"passw" : $("#passw").val(),
// 'test' : "whl",
},
dataType : "json",
type : "post",
// async : false,
success : function(ok) {
if (ok) {
// alert("是否存在");
$("#login").css("display", "none");
$("#haslogin").css("display", "inline").html(
$("#email").val());
close_login();
} else {
$(".info").addClass(
"Validform_wrong Validform_checktip")
.html("用户名或密码错误!");
}
}
});
}
})
})
<div id="loginbg"></div>
<div id="v-login" style="display:none;">
<h2>
<span class="left">登录</span>
<span class="right v-login-close" onclick="close_login()"></span>
</h2>
<form class="login" method="post" action="javascript:void(0)">
<div class="v-login-item clearfix">
<label class="v-login-label">帐号:</label>
<input class="v-login-input" type="text" id="username" name="username" />
</div>
<div class="v-login-item clearfix">
<label class="v-login-label">密码:</label>
<input class="v-login-input" type="password" id="passw" name="passw" />
</div>
<div class="clearfix">
<label class="v-login-label"></label>
<div style="float:left;">
<input type="checkbox" class="v-login-checkbox" id="savelogin" name="savelogin" value="1"/>
<label>下次自动登录</label>
<a class="cblue" title="忘记密码" href="#">忘记密码?</a>
</div>
</div>
<div class="clearfix">