ITeye博客

Jquery array remove

夜鸣猪 · 2013-04-10 21:38 · javascript Jquery ext prototype · Ruby On Rails · 编程语言 · Markdown



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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。