javascript - Setting text for external HTML file -


i trying set text div located in external html file, when give id of div, not recognized, should do? load external html file this:

$('#header').load("resources/html/header.html"); 

then try set "headertitle" inside header.html

$('#headertitle').text($('#buidlingcombobox :selected').text());   

if give id inside main html file, works fine.

you have wait until content available, , load() has handy callback :

$('#header').load("resources/html/header.html", function() {     $('#headertitle').text( $('#buidlingcombobox').val() );   }); 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -