C# 等待ajax完成mvc ajax的浏览器
我有一个用MVC3编写的应用程序。我有一个页面,通过使用ajax异步加载大型图形:C# 等待ajax完成mvc ajax的浏览器,c#,jquery,ajax,asp.net-mvc-3,C#,Jquery,Ajax,Asp.net Mvc 3,我有一个用MVC3编写的应用程序。我有一个页面,通过使用ajax异步加载大型图形: var graphRequest; function ReloadGraph() { if ($('#graph').length < 1) { return; var graphData; // get the graph data graphData = GetGraphData(); } graphRequest = $.ajax
var graphRequest;
function ReloadGraph() {
if ($('#graph').length < 1) {
return;
var graphData;
// get the graph data
graphData = GetGraphData();
}
graphRequest = $.ajax({
cache: true,
type: 'POST',
data: { selectedReportID: selectedReportID, selectedUnit: unit, price: price },
url: "/Dashboard/GetGraphData",
async: true,
dataType: "json",
success: function (result) {
RenderGraph(result);
});
但没有任何优势。任何建议或指导都会很好
谢谢
$('#nav a').live('click', function () {
console.log("aborting");
graphRequest.abort();
});