开发者

$.ajax equalivant for $.load content filter

jQuery lets me filter content when using $.ajax()'s shorthand $.load() like following:

$('#foo').load('/path/to/foo.html #navigation li');

How do implement this same functionality using $.ajax(); ?

开发者_如何学C
$.ajax({
    url : 'nextpage.php',
    /* get me some specific elements */
})


Something like this should do what you want:

$.ajax({
    url : 'nextpage.php',
    // …
    success: function(result) {
        $('#foo').html($(result).find('#navigation li').get(0));
    }
})
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜