开发者

About elements display in named arrays

开发者 https://www.devze.com 2023-01-30 00:58 出处:网络
i have following code Now i want to display the elements in each place which are comma delimited in a table as for each delimited value in one cell.. means 01 in first cell ABC in second cell, MCA in

i have following code Now i want to display the elements in each place which are comma delimited in a table as for each delimited value in one cell.. means 01 in first cell ABC in second cell, MCA in third cell... how to split plz tell me.. thank you

 function showData()
  {
  namedArray['id1']='01,ABC,MCA';
  namedArray['id2']='02,DEF,MCA';
  namedArray['id3']='03,GHI,MCA';
  namedArray['id4']='04,JKL,MCA';
  var i=0;
  var length=0;
  for (var obj in namedArray )
  {
    length++
  }
  alert(length);
  //var x=namedArray['id2'];
    //开发者_如何学Pythonalert(x);
    var tabid=document.getElementById('mytable');
        var tlength=tabid.rows.length;
        i++;

        var cell1=row.InsertCell(0);
        var cell2=row.InsertCell(0);
        var cell3=row.InsertCell(0);


var where_is_mytool="home/mytool/mytool.cgi";
var mytool_array=where_is_mytool.split("/");

<SCRIPT language="JavaScript">
<!--
function divide_string()
{
var where_is_mytool="home/mytool/mytool.cgi";
var mytool_array=where_is_mytool.split("/");
alert(mytool_array[0]+" "+mytool_array[1]+" "+mytool_array[2]);
}
//-->
</SCRIPT>

You can query the amount of split why using where_is_mytool.length

0

精彩评论

暂无评论...
验证码 换一张
取 消