(function( $ ) {
$(function() {
$( '.AddRow' ).delegate( 'click', function() {
var $this = $( this ),
$tbody = $this.parents( '.tbody' );
$tbody.find( 'td:nth-child(-2)' ).css( 'background', 'red' );
});
});
})( jQuery );
我收到以下错误:
Timestamp: 07/08/2013 21:02:49
Error: TypeError: "".match is not a function
Source File: file:///C:/Program%20Files/Wamp/www/kbd-creator/v5/jquery-1.10.2.min.js
Line: 5
我尝试将 .delegate 更改为 .on 并且错误不再出现。我对 .delegate 做错了吗?