jquery is used after

Source: Internet
Author: User

1. Dynamic binding

When you want to bind the event suddenly no effect, this situation appears in through the JS Spell button binding event, later checked the data, you can use the Live event delegate, or with on, because it is to the button binding event so you can also directly write in the spelling of the HTML code inside

2checkbox encounters jquery.

Encounter a browser compatibility issue, the problem is that when making a multi-select, use jquery to get all the checkbox elements, check, uncheck, Firefox no problem, Chrome is no problem, then select, Chrome can't show the style, Using pure jquery has been unable to debug the right results. The jquery object is then fetched from the JS object, then the checkbox element has a check property, traverses the jquery object and then extracts the JS object and assigns a value to the Check property.

3.ajax Response and Java objects

When the Java background returns a Boolean object, then in the JS response is also a Boolean object, if Java returns a string (first the string to JSON, one method is to first put the string array and then go to JSON), then the JS The object is obtained in response, which can be viewed with typeof so that a powerful function can be achieved.

4. In the SPRINGMVC. From the sending request to the background to get the data, to go through the formatter, validator, but in the real project everyone seems to have not noticed this problem, and even do not have enough format validation of the form's data, for example, does not make a date is a previous time validation, does not validate the length of a field, Because it's really not that simple.

At this point, you can use the conclusion of 3, instead of Spring verifier or formatter, but write a verification method, and if you use Ajax to submit the form, then you can get the error message, and display it. You can also use model. You can also go out and show it in the page.

jquery is used after

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.