javascript - Dynamically fill div with same ID using jQuery -
i using history.js dynamically fill body of html pages in order prevent entire page refreshes. however, having trouble getting data , filling div if same id. of pages structured: <div id="content"> <div id="container"> ... here current jquery/history.js history.adapter.bind(window, 'statechange', function() { var state = history.getstate(); $.get(state.url, function(data) { $('#content').fadeto(600, 0, function() { $('#content').html($(data).find('#container').html()).delay(200).fadeto(600, 1); }); }); }); i want able data 'content' , fill 'content' div, when change variable in find() 'content', return nothing. why don't use this? : $('#content').fadeto(600, 0, function() { $(this).children('#container').html(data).delay(200).fadeto(600, 1); });