1
我有这个.get()
返回的数据是从网址罚款,但当它循环通过,并没有在该网址所需的数据它不会返回警报与.error();
或甚至.fail();
想要发生的行动,如果它找不到它找什么,我做错了什么?jquery .get()似乎失败,但不能得到一个消息回
$.get('/jsp/landing.jsp?id=FiresContent', function(data){
var DataReturned = $(data).find('#' + topNavliID +' > div').each(function(index){
SkuDetail = "<li id='" + index + "'><article><ul><li class='sku-" + index + "'>" + $(this).find('.sku').text() + "</li>";
SkuDetail = SkuDetail + "<li class='prodName-" + index + "'><h2>" + $(this).find('.prodName').text() + "</h2></li>";
SkuDetail = SkuDetail + "<li class='prodDesc-" + index + "'>" + $(this).find('.prodDesc').text() + "</li>";
SkuDetail = SkuDetail + "<li class='action-" + index + "'><a href='" + $(this).find('.actionLink').text() + "' title='" + $(this).find('.action').text() + "'>" + $(this).find('.action').text() + "</a></li></ul></article></li>";
ThumbNail = "<li class='thumbImage-" + index + "'><img src='/images/CAT110/FireSurrounds/thumbnail_" + $(this).find('.sku').text() + ".jpg' alt='" + $(this).find('.prodNameShort').text() + "' title='" + $(this).find('.prodNameShort').text() + "'>";
ThumbNail = ThumbNail + "<span class='prodNameShort-" + index + "'>" + $(this).find('.prodNameShort').text() + "</span></li>";
$('#largeSlides').css('width','+=1000');
$('#largeSlides').append(SkuDetail);
$('#thumbSlides').append(ThumbNail);
// remove loading image once loaded.
$('.loadingmessage').fadeOut(800, function(){
$(this).remove();
});
});
}).fail(function(){ alert("$.get failed!"); });
//.error(function() { alert("error"); });
http://stackoverflow.com/questions/4062317/jquery-get-error-response-function 这个问题可以帮助你一些。 – 2012-07-05 15:33:59