"Original" resolves an issue in which jquery cannot parse XML strings of string-type XML structures in IE

Source: Internet
Author: User

$.fn.extend ({//This method solves the problem that jquery does not recognize XML strings of non-XML types in IE. Tony TanFINDX:function(name) {if( This&& This. length && This. length > 0 && This[0]) {                        var_R1 = ' < ' + name + ' > ', _r2 = ' <\/' + name + ' > '; var_exp = _r1 + '. +? ' +_r2; var_t_r = This[0].innerhtml.match (NewREGEXP (_exp, ' G ')); if(_t_r && _t_r.length > 0 && _t_r[0]) {                             This. html =function () {                                return_t_r[0].replace (_R1, "). Replace (_R2,"); }                        }                    }                    return  This; }            });

Usage notes:

Suppose $ (this). Find (' ATTR1 '). HTML () cannot be used, then after referencing the above code, use $ (this). Findx (' attr1 '). HTML () must be useful

"Original" resolves an issue in which jquery cannot parse XML strings of string-type XML structures in IE

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.