Jquery陣列操作

白馬酒涼發表於2013-08-26

http://welcome66.iteye.com/blog/1627850

http://www.cnblogs.com/AndyWithPassion/archive/2011/06/20/jquery_array_process.html

1.拼接陣列成字串

var dataArray = [];
var data1="test1";
var data2="test2";
dataArray.push(data1);dataArray.push(data2);
dataArray.toString();  //  "test1,test2"

2.去掉陣列裡面某個元素

var index = jQuery.inArray(data2, dataArray)
dataArray.splice(index, 1);



相關文章