jQueryの.loadmethdodを使用してページの内容を変更してみました。
コンテンツは問題なく変更されましたが、何かを選択しようとすると、jQueryはまだ古いコンテンツを「認識」していることがわかりました。例:
ページ:
<div id="mycontentarea">
<div id="myfirstcontent"></div>
<div id="mysecondcontent"></div>
</div>
コンテンツの置き換え:
<div id=mythirdcontent"></div>
<div id=myfourthcontent"></div>
javascript:
// replace original content
$('#mycontentarea').load('replacement.html');
// print out the id of the first child
console.log($("#mycontentarea").children().attr("id"));
コンソールは「mythirdcontent」ではなく「myfirstcontent」を出力します-なぜですか?