1
我想從php控制器中檢索數據,以下短語代替產品1,2,3等,並且出售編號爲380,655,275等,但我不知道如何使用jQuery進行檢索。如何從php控制器在jquery中檢索數據
Morris.Bar({
element: 'graph_bar',
data: [
{device: 'Product1', sellingcount: 380},
{device: 'Product2', sellingcount: 655},
{device: 'Product3', sellingcount: 275},
{device: 'Product4', sellingcount: 1571},
{device: 'Product5', sellingcount: 655},
{device: 'Product6', sellingcount: 2154},
{device: 'Product7', sellingcount: 1144},
{device: 'Product8', sellingcount: 2371},
{device: 'Product9', sellingcount: 1471},
{device: 'Product10', sellingcount: 1371}
],
xkey: 'device',
ykeys: ['geekbench'],
labels: ['Geekbench'],
barRatio: 0.4,
barColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
xLabelAngle: 35,
hideHover: 'auto',
resize: true
});
我想要從php控制器中檢索下面的短語來代替product1,2,3等(控制器的數據)和sellingcount no(控制器的數據)380,655,275等,但我不知道如何使用jquery從控制器回顧數據 –
您是想異步接收數據還是構建視圖? –