I am trying to retrieve a div using ajax .get and its ID attribute. The ajax call works but it returns the full page instead of just the div of id top.
$.get(page + ' #top', function(data){
topContent= data;
});
Page is just the url of the page eg: gridpView.php. The above code works perfectly with the .load function. I am trying to load in several div’s before I use them so load is not an option.
What am I doing wrong? Is the .get function capable of retrieving a div?
That sort of thing works with
loadbut I don’t believe it works withget. You’ll need to get the whole page and then grab the part you want: