2
是否有可能在AJAX请求后添加一个jQuery选择器到URL参数? 这是我的工作完美代码:添加一个jQuery选择器到URL参数
$.ajax({
type : "POST",
url : "load_page.php",
data : 'page=' + url,
success : function(msg) {
if (parseInt(msg) != 0)//if no errors
{
$content.fadeIn(200, function() {
$('#content').html(msg);
});
}
}
});
//load the returned html into pageContent
$("# content'").load("demo_test.txt #sub.content");
但有可能通过$('#content').html(msg);
?
附加信息: 我想只能获得<div id=”sub-content”>
的' “/你/ URL #selector”'语法只适用于'.load()'。 –