다음과 같은 현상에 대해 누구도 알 수 있습니까?브라우저 JQUERY 데이터 캐시 IE7
나는 그때 입력 한 데이터가 표시되지 않는 그래프 HighChart를 포함하는 ASPX 페이지로 이동 데이터베이스에 레코드를 입력하면 ASP.NET MVC 응용 프로그램이 대상 플랫폼 IE7
에서 실행해야합니다. 차트를 표시하려면 데이터를 얻으려면 브라우저를 닫고 응용 프로그램을 다시로드해야합니다.
디버그 모드에서 응용 프로그램을 실행하고 코드가 컨트롤러의 중단 점에 도달하지 않습니다. 마치 클라이언트 JQUERY 코드가 변경 사항이 없다고 생각하고 캐싱하는 것처럼 말입니다. 컨트롤러는 작동하지 않지만 이전 데이터로 작업하는 것처럼 실행됩니다.
내가 응용 프로그램을 다시로드 할 때 (중지 및 시작) 컨트롤러 화재 내가 디버깅 할 수와 최신 데이터가
미친 물건에 오는 것을 보장하기 위해 어딘가에서 web.config 아마도 설정을 할 수 또는합니다 클라이언트 JSON은 항상 컨트롤러와 캐시하지 고토 호출
아래 필요한 경우 많은
J
CODE
감사 모든 의견 :function CreateChart1(surl) {
// Code block for fetching Array as jsonResult (js)
var url = $("#AbsolutePath").val() + "Incident.mvc/GetChartData_IncidentsBySiteStatus/" + surl;
var chart;
$.getJSON(url, null, function(data) {
var result = [];
jQuery.each(data, function(i, val) {
result[i] = [val.Site, parseInt(val.Count)];
});
chart = new Highcharts.Chart({
chart: {
renderTo: 'chart1',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'Number of Environmental Incidents by Site Status'
},
tooltip: {
formatter: function() {
return '<b>' + this.point.name + '</b>: ' + this.y + ' (' + Math.round(this.percentage) + '%)';
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true
},
showInLegend: false
}
},
exporting: {
enabled: true
},
series: [{
type: 'pie',
name: 'Incidents by Site Status',
data: result
}]
});
});
};
컨트롤러 코드 :
public JsonResult GetChartData_IncidentsBySiteStatus(string SiteTypeId, string searchTextSite, string StartDate, string EndDate)
{
if (searchTextSite == null)
searchTextSite = "";
DateTime startDate = DateTime.Parse(StartDate);
DateTime endDate = DateTime.Parse(EndDate);
IQueryable<Site> sitesQry = _db.Sites;
if (SiteTypeId != "-1")
sitesQry = sitesQry.Where(a => a.SiteTypeId.ToString() == SiteTypeId);
var qry = from i in _db.Incidents
join s in sitesQry on i.SiteId equals s.SiteId
where s.SiteDescription.Contains(searchTextSite)
&& (i.Raised >= startDate && i.Raised <= endDate)
group s by s.SiteStatus.SiteStatusDescription + "[" + s.SiteTypeId.ToString().Replace("1","ON").Replace("0","OFF") + "]"
into grp
select new
{
Site = grp.Key,
Count = grp.Count()
};
return Json(qry.ToList() , JsonRequestBehavior.AllowGet);
}
http://stackoverflow.com/questions/264216/getjson-returning-cached-data-in-ie8 : 당신이 캐싱을 비활성화해야합니다 지정할 수 있도록 전화를 확인하기 위해
ajax
방법을 사용할 수 있습니다 이게 도움이 될거야. – Rafay