jQuery(document).ready(function() {
//输入事件
$("input[id]").bind("focus",function () {
if($(this).attr("id")=='username'||$(this).attr("id")=='password')
$(this).attr("value","");
});
//提交
$("#submit").bind("click", function() {
if (valid()) {
$.ajax({
type: "POST",
url: "/my/servlet/LoginServlet",
data: $("form#loginform").serialize(),
success: function(msg){
if(msg=='success'){
$.mobile.changePage("../index/index.html","slide",false,true);
}else{
$.mobile.changePage("../message.html","slide", true, false);
}
}
});
}
});
});
js post 提交表单
最新推荐文章于 2024-02-07 08:43:17 发布
350

被折叠的 条评论
为什么被折叠?



