Reputation: 21627
$.get('text.php', {}, function(data) {
var $response = $('<div />').html(data);
var $jeremy= $response.find('#jeremy')
var $kyle = $response.find('#kyle');
$('#right').append($jeremy).append($kyle);
},'html');
Would the above be the most efficient and DRY method of calling in multiple div's with one ajax call?
Upvotes: 0
Views: 350
Reputation: 1672
More efficient and less DRY but less readable too:
$.get('text.php', {}, function(data) {
$('#right').append( $('<div />').html(data).find('#jeremy, #kyle') );
},'html');
Upvotes: 1