I have a simple ajax request loading in an external html file but it’s pulling in the entire page rather than just the specific div I requested. Does this only work using the .load?
$.ajax({
url: 't3.html #test',
success: function(data) {
$('.incoming').append(data);
}
});
Use
load()method which will filter the external page for the selector you wantOtherwise using other AJAX methods you would need to create your own filter, they do not parse the url for the content themselves:
Refernce: http://api.jquery.com/load/