数组中的jQuery数组

数组中的jQuery数组,jquery,arrays,jqplot,Jquery,Arrays,Jqplot,大家好,我有一个关于数组中的数组以及如何调用它的小问题。。。 例: 要调用所有数组并对每个数组执行一个函数,我将使用。每个jQuery函数 $.each(plotName,function(cName,pName){ chartName[cName]; var pName = $.jqplot(''+chartName[cName]+'', [/* another var */], { //my code here }); }); 现在,因为我

大家好,我有一个关于数组中的数组以及如何调用它的小问题。。。 例:

要调用所有数组并对每个数组执行一个函数,我将使用。每个jQuery函数

$.each(plotName,function(cName,pName){
     chartName[cName];
     var pName = $.jqplot(''+chartName[cName]+'', [/* another var */], {
          //my code here
     });
});
现在,因为我需要第三个变量,所以我希望在数组中有一个数组,如:

var plotName = [['bearShevaPlot', 'bearSheva'], ['haifaPlot', 'haifa'], ['tiberiasPlot', 'tiberias'], ['kfarSabaPlot', 'kfarSaba'], ['netanyaPlot', 'netanya'], ['rishonLezionPlot', 'rishonLezion'], ['rehovotPlot', 'rehovot'], ['telAvivPlot', 'telAviv']];
我的问题是如何调用“bearSheva”,它是数组中第一个数组的第二个val


感谢您的帮助,并对我的英语不好表示歉意:)

firstPlot
&
secondPlot
将具有所需的值

var chartName = ['bearShevaCity', 'haifaCity', 'tiberiasCity', 'kfarSabaCity', 'netanyaCity', 'rishonLezionCity', 'rehovotCity', 'telAvivCity'];
var plotName = [['bearShevaPlot', 'bearSheva'], ['haifaPlot', 'haifa'], ['tiberiasPlot', 'tiberias'], ['kfarSabaPlot', 'kfarSaba'], ['netanyaPlot', 'netanya'], ['rishonLezionPlot', 'rishonLezion'], ['rehovotPlot', 'rehovot'], ['telAvivPlot', 'telAviv']];

$.each(plotName,function(cName,pName){
     var chart = chartName[cName];
     var firstPlot = pName[0];
     var secondPlot = pName[1];
     var pName = $.jqplot(''+chartName[cName]+'', [/* another var */], {
          //my code here
     });
});
希望能有帮助

var chartName = ['bearShevaCity', 'haifaCity', 'tiberiasCity', 'kfarSabaCity', 'netanyaCity', 'rishonLezionCity', 'rehovotCity', 'telAvivCity'];
var plotName = [['bearShevaPlot', 'bearSheva'], ['haifaPlot', 'haifa'], ['tiberiasPlot', 'tiberias'], ['kfarSabaPlot', 'kfarSaba'], ['netanyaPlot', 'netanya'], ['rishonLezionPlot', 'rishonLezion'], ['rehovotPlot', 'rehovot'], ['telAvivPlot', 'telAviv']];

$.each(plotName,function(cName,pName){
     var chart = chartName[cName];
     var firstPlot = pName[0];
     var secondPlot = pName[1];
     var pName = $.jqplot(''+chartName[cName]+'', [/* another var */], {
          //my code here
     });
});