Jq method, attributes, jq method attributes

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.