Jq method, attributes, jq method attributes
1. jq change () event
When the element value changes, a change event occurs. This event is only applicable to text fields, textarea, and select.
When applicable to select elements, the change event will occur when an option is selected. When applicable to text or textarea, the change event will be triggered when the text field loses focus.
2. jq ajax () method
Jq code:
$ (Function () {$ (". box "). click (function () {htmlobj = $. ajax ({url: "test.txt", async: false}); $ ("p" ).html (htmlobj. responseText );});})
Html code
<Div class = "box"> click me </div> <p> </p>
The encoding format of test.txt must be the same as that of html. Otherwise, it will be garbled. You can set the encoding when saving the file.
Async: Boolean value. true indicates an asynchronous request. false indicates a synchronous request. asynchronous requests are used by default.
Note:: The synchronous request locks the browser. Other operations can be performed only after the request is completed.