var IDs = [];
$("table").find("span").each(function(){ IDs.push(this.id); });
alert(IDs)

解决方案 »

  1.   

    你好,以前的代码是这样的
    Line("bel1,bel2,bel3","18","7","#4282e3");
    现在改了之后
    Line(IDs,"18","7","#4282e3");var Line = function(cords,tw,pw,color){
          var crd = cords.split("|"), 这里报错 (Uncaught TypeError: undefined is not a function)
         .....
    }
      

  2.   

    Line("bel1,bel2,bel3","18","7","#4282e3");
    这里是字符串,
    你可以这样
    Line(IDs.toString(),"18","7","#4282e3");另外,从你的
    ar Line = function(cords,tw,pw,color)
    定义来看,
    cords应该是以|分割的字符串。
    如果转成|分割的字符串,可以
    Line(IDs.join("|"),"18","7","#4282e3");