I have this jquery code:
$.ajax({
url:'ajax/windowshop.php',
context:'#windowShop',
success:function(data){
$('#windowShop').append(data);
}
})
I want to select the contents of #windowShop from the page ajax/windowshop.php and insert them into an element on the current page. I can’t find much documentation on context when using the ajax command and this doesn’t seem to work because data contains the whole page ‘ajax/windowshop.php’ and not just the contents of (‘#windowShop’) in ajax/windowshop.php.
You could select the content from the
datacoming back. For example if all of the main content is in a div withid="content"you could grab that…