我有需要從不同的靜坐一些數據,使用asp.net MVC/jquery load返回空,可能MVC 2的問題?
的數據得到加載從這些頁面的網站:
http://charity.hondaclassic.com/home/totaldonations
http://charity.hondaclassic.com/Home/CharityList
這應該是沒有道理的,但由於某種原因,我得到一個空的響應,這是我的JS:
<script>
jQuery.noConflict();
jQuery(document).ready(function($){
$('.totalDonations').load('http://charity.hondaclassic.com/home/totaldonations');
$('#charityList').load('http://charity.hondaclassic.com/home/CharityList');
});
</script>
在Firebug我看到的請求,而且用200 OK b A響應回來如果你瀏覽這些網頁,他們的工作很好!有沒有搞錯?
下面是從MVC站點控制器操作:
public ActionResult TotalDonations() {
var total = "$" + repo.All<Customer>().Sum(x => x.AmountPaid).ToString();
return Content(total);
}
public ActionResult CharityList() {
var charities = repo.All<Company>();
return View(charities);
}
有人請了什麼,我缺少的愚蠢的小事情 - 這應該採取我5分鐘,它一直小時!
當你進入charity.hondaclassic.com網站時,它會拋出一個錯誤,*必須指定'varByParam'屬性* – 2009-11-30 21:18:52
來糾正我的評論,不起作用的鏈接是你問題中的鏈接,鏈接在你的代碼裏面工作。 – 2009-11-30 21:19:56
解決了我的拼寫錯誤,我在輸入緩存中添加了真正的快速,對此感到抱歉 – Slee 2009-11-30 21:47:12