【发布时间】:2012-05-16 18:46:27
【问题描述】:
我使用 ajax 加载第二个页面,并希望将该页面中的特定 id 附加到当前页面。
function Content() {
$("ul.tabs li a").click(function() {
$.ajax({
url: $(this).attr('href'),
success: function(response) {
$(response).find('ul#image-gallery-items').appendTo('ul#image-gallery-items');
}
});
return false;
})
}
我错过了什么?
【问题讨论】:
-
什么不起作用? “我错过了什么?” 问题中有很多信息......
-
您要附加一个
ul作为另一个/相同ul的直接子代?你的意思是$(response).find('ul#image-gallery-items li')吗? -
@F.Calderan。是同一个身份证。缺少信息...
-
哦抱歉 :D.. 好吧,我收到了请求,但它不会附加它.. 没有发生:P
-
我试过这个:$("#image-gallery-items").html($(response).find("#image-gallery-items").children());但这只是给了我一个空的