Jquery array remove

阅读更多

Array.prototype.remove = function(el){
    return this.splice(this.indexOf(el),1);
}
var arr = [1,2,3,4,5];
arr.remove(4);
console.log(arr);//[1,2,3,5]

var array = [1,2,3,4,5];
array.splice(2,1);
console.log(array);//[1,2,4,5]

y.splice( $.inArray(removeItem, y), 1 );


$(window).load(function () {
// run code
});


$('img.userIcon').load(function(){
if($(this).height() > 100) {
$(this).addClass('bigImg');
}
});




http://forum.jquery.com/topic/document-ready-and-window-onload-difference

你可能感兴趣的:(js)