我的观点发生了一些奇怪的事情。我将 Json 结果返回到我的视图以显示有关 ajax 调用的数据。如果我的 data.length==0,我会尝试显示一条小消息
没有适用于此标准的数据
另外我正在使用 $.blockUI (说请稍候),当我的 data.length = 0 时,我的页面仍然说请稍候......很长时间,当我在 Firefox 中运行它时,我收到了消息
此页面上的脚本可能正忙,或者可能已停止响应
我的观点:
<script type="text/javascript">
//<![CDATA[
$("#GetReport").click(function () {
$.blockUI({
css: {
border: 'none',
padding: '15px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .5,
color: '#fff'
}
});
$.ajax({
type: "POST",
url: theUrl,
data: { 'manufacturer': manufacturer, 'country': country, 'category': category, 'startDate': startDate, 'endDate': endDate, 'chartType': chartType },
dataType: "json",
success: function (data) {
//setTimeout($.unblockUI, 5);
var retailerNameArray = [];
var clicksArray = [];
var weekNoArray = [];
var rowTotalArray = [];
var weekArray = [];
var columnTotalArray = [];
var cumTotalArray = [];
var weekCounterArray = [];
var overallClickCountArray = [];
var resellerShareArray = [];
var retailerCount = 0;
//we want to include total in the chart
var weekNoArrayIncTotal = [];
var retailerNameArrayIncTotal = [];
var clicksArrayIncTotal = [];
var totalWeekCounter;
var weekNumberIncTotal = 0;
var counter = 1;
//if there is no data we do not want to display the graph etc
if (data.length == 0) {
$('#noData').show();
$('#chartContainer').hide();
$('#tableContainer').hide();
$('.exportData').hide();
}
//we need to add one more because of total but then 0 it
for (var i = 0; i < data.length; i++) {
var cumLeadrow = data[i];
// var y = 1;
//Only display on graph if not 0
}
});
});
//]]>
没有可用于指定标准的数据
一如既往,任何帮助将不胜感激。