去掉最后一个逗号
var ids="";for(var i=0;i<selectid.length;i++){?? ??? ??????? ?? ids+=selectid[i].get("gatherTimeId")+",";}alert(ids.replace(/,$/,""));