This article mainly introduces jquery's methods of capturing the carriage return key and obtaining the checkbox value and asynchronous request. The example analyzes jQuery's techniques for capturing the carriage return key, obtaining the checkbox value, and responding to asynchronous requests, for more information about how jquery captures the carriage return key and obtains the checkbox value and asynchronous request, see the following example. We will share this with you for your reference. The details are as follows:
1. jquery:
$ ("Html "). die (). live ("keydown", function (event) {if (event. keyCode = 13) {// here add the logic to be processed }});
2. jquery obtains multiple 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! ");}}});
I hope this article will help you with jQuery programming.