1. jquery captures the Enter key:
$("html ").die().live("keydown",function(event){
if(event.keyCode==13){
//Add the logic to be processed here
}
} );
//Bind carriage return action
$('textarea[name=chattext]').keydown(function(event){
if(event.which==13){
}
});
2.jquery to get multiple selected checkbox values:
$('input[type="checkbox"][name="types"]:checked').each(function() {
types = types $(this).val() "|";
}
);
3.jquery asynchronous request method:
$.ajax({
url : "${pageContext.request.contextPath }/UOSRoleManangerAction.do?method=createRole",
type : "post",
dataType : "html",
data:{"roleName":roleName,"roleDescription":roleDescription,"roles" :roles,"types":types},
success : function(data){
var dataObj=eval("(" data ")");
if(dataObj.result){
alert("Operation successful!");
submitForm(null,"initPage");
}else {
alert("Operation failed!");
}
}
});
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn