ajax - jquery get fragment gets whole page -
anybody has experienced this, may wrong? use ended space followed id/hash of element on other page jquery loads whole page....
snippet here:
var url = $(this).attr('href'); url = url+' #detail'; console.log('loading '+url); $.get( url, function(dt){datadetail = dt;} ); $('#result').append(datadetail);
there element id="detail" on other page, both pages on same domain, yet loads whole page instead of fragment... may wrong?
$.get
doesn't work way, there no filter. load()
has that, , still gets everything, filters before outputting.
what want like
var url = $(this).attr('href'); $.get( url, function(dt){ var datadetail = $('<div />', {html : dt}).find('#detail'); $('#result').append(datadetail); });
Comments
Post a Comment