Question about the compatibility of juqeryradio writing (new and old versions of jquery) _ jquery

Source: Internet
Author: User
Recently, the customer reported that some page effects did not respond. After searching, it was found that there was a problem with juqery's Writing Method (jquery obtained the radio value), mainly because some implementation methods were modified in the new version. As follows:

The Code is as follows:


$ ("Input [name = 'isiel'] [checked]"). val ()
$ ("[Name = 'isiel'] [checked]"). val ()
=


The above only applies to earlier versions of IE (IE6 and below)
Later versions of IE or Firefox need to be changed
$ ("Input [name = 'isiel']: checked"). val ()

Test jquer Versions 1.4 and 1.3.2

How to obtain radio from new and old juqery versions
Today, I changed a later version of jquery and found that the original normal method reported an error. After careful searching, I found that jquery's method for obtaining radio is as follows:

New Version (1.3.2, 1.4.2 ):

$ ("[Name = 'Radio _ name'] [checked]"). val (), or $ ("input [name = 'Radio _ name']: checked "). val ()

Old Version:

$ ("[@ Name = 'Radio _ name'] [checked]"). val (), or $ ("[@ name = 'Radio _ name']: checked "). val ()

The difference is that the old version has an additional @ symbol.
PS: When you upgrade jquery, you 'd better first check some information to improve efficiency.
Related Article

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.