我有一个 web 应用程序,它有几个 highcharts、几个数据表以及与所有这些相关的配置设置。目前我通过多个变量引用它们。像这样:
var charts = {};//associative array of HighCharts
var tableInit = {};//table legend and other initialization data, also includes references to tables
var cache = {};//associative array of Table Cache
做这样的事情会更好或更糟吗?
var data_store = {
'tableInit' : {},//table legend and other initialization data
'category' : {
'-1' : {
'chart' : $reference_to_Highchart,
'table' : $reference_to_DataTable,
'cache' : {}//object to store DataTable cache
}
}
}