The example in this article describes the way jquery captures the ENTER key and gets the checkbox value and the asynchronous request. Share to everyone for your reference, specific as follows:
1, jquery capture Enter:
$ ("html"). Die (). Live ("KeyDown", function (event) {
if (event.keycode==13) {
//Add the logic to be processed
}
});
2.jquery get multiple checked 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 succeeded!) ");
SubmitForm (NULL, "Initpage");
} else {
alert (operation failed!) ");
}
}
});
I hope this article will help you with the jquery program design.