javascript数据缓存
if(!self.hotCityPrice[city]) { $.ajax({ type: 'GET', url: self.hotCityUrl, data: {cityCode: city, t: new Date().getTime()}, success: function(res) { if(res.bstatus.code == 0) { try { self.insertPriceListHtml(res.data.carTypes); self.hotCityPrice[city] = res.data.carTypes; } catch(e) { } } else { alert(res.bstatus.des); } } }); } else { self.insertPriceListHtml(self.hotCityPrice[city]); }