下面是代码和错误消息:
网页错误详细信息
用户代理程序: Mozilla/4.0 (兼容;MSIE8.0;Windows 6.1;WOW64;Trident/4.0;SLCC2;.NET CLR 2.0.50727;.NET CLR 3.5.30729;.NET CLR 3.0.30729;Media Center PC 6.0;.NET4.0C;.NET4.0E;InfoPath.2)时间戳: Wed,2012年1月18日:26:33 UTC
消息:对方法或属性访问的意外调用。行:3 Char: 31959代码:0 URI:https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
和Jquery代码:
<script type="text/javascript">
$(document).ready(function() {
$('.small-list-items-pagination li a').click(function(e) {
e.preventDefault();
$.ajax({
type: "GET",
url: '/Noticias/FetchMiniNoticiasFromPage',
data: "page=" + $(this).text(),
dataType: "json",
success: function (data) {
$('.small-list-items li').remove();
$.each(data, function(i, val){
$(".small-list-items").append('<li>' +
'<img src="' + val.ImagenChicaUrl + '" alt="' + val.Descripcion + '"/>' +
'<a href="#">' + val.FechaDePublicacion + '</a>' +
'<p>' + val.Descripcion + '</p>' +
'<div class="horizontal-line"></div>' +
'</li>');
});
},
error: function (obj) {
alert("bad!");
}
});
});
});
</script>有什么好主意吗?这在Firefox,Opera,Google中非常有用。
这一行:
'@Url.Action("FetchMiniNoticiasFromPage", "Noticias")'实际编译为:
'/Noticias/FetchMiniNoticiasFromPage'发布于 2012-01-18 20:40:38
这可能是嵌套的双引号,尽管我无法想象其他浏览器可以让您逃脱这一点:
url: "@Url.Action('FetchMiniNoticiasFromPage', 'Noticias')",-或者
url: '@Url.Action("FetchMiniNoticiasFromPage", "Noticias")',还是你想:
url: "@Url.Action("+FetchMiniNoticiasFromPage+", "+Noticias+")",https://stackoverflow.com/questions/8916931
复制相似问题