$.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));
}
})
精彩评论