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);     }); 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -