Table dynamically added TR its Click event does not perform the jquery 1.9 live event in IE compatibility mode and gets first last

Source: Internet
Author: User

Http://www.css88.com/jqapi-1.9/first-of-type/index.html#p=//www.css88.com/jqapi-1.9/last-child-selector

---dynamically added table TR to TR set click event using jquery 1.9

function () {$ ("#tableid tbody"). Find ("tr"). Removeclass ("Trclass"); $ (this). AddClass ("Trclass" ); var name = $ (this). attr ("Data"); $ ("#txtsearch"). Val (name);});
 functionchangetable () {varn = $.trim ($ ("#txtsearch"). Val ()); if(n! = ""{$.ajax ({type:"POST", URL:".. /xxx/xx.aspx?action=getxx ", data: {N: n}, DataType:"JSON", Async:false, Success:function(data) {varVarc = ""; $.each (data. Table,function(Index, item) {Varc+ = "<tr data=" + item.id + "><td>" + item.id + "</td><td>" + item.name + "</td></tr&gt ;";                        }); $("#tableid tbody"). Empty (). append (Varc); }, Error:function () {                    }                }); }        }

--first (First-of-type) Last (Last-of-type)

function () {                var n1 = $ (thisvar n2 = $ (this). attr ("data2");                Down (N1, N2);            });            $ (document). On (function  () {                var n = $ (this). attr ("Data"  );                Delattach (this, n);            });

Table dynamically added TR its Click event does not perform the jquery 1.9 live event and gets first last

in IE compatibility mode

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.