JS:
$(document).ready(function(){
$("#loader").load("external.html");
$("#buttonClickText").live('click', function() {
$("#buttonClickText").text("Text changed after button click.");
});
// MYSTERY FUNCTION
$("#pageLoadText").text("Text changed after external HTML was loaded.");
//
});
外部 HTML:
<div id="buttonClickText">
This text changes when clicked.
</div>
<div id="pageLoadText">
This text should have changed when external HTML was loaded, but didn't.
</div>
メイン HTML (関連するタグのみを表示):
<div id="loader"></div>
また、.live() は jQuery 1.7 以降では非推奨であることを知っています。解決策は .on() を使用して同様になると思います
ありがとう!