jquery loadでdivにページをロードする時、ページjsを実行しない問題を解決します。


jqueryコード:

$(function(){
$("#test").load("${contextPath}/notepad/toCreate.do");
}
ロード$
このような方式は実現できません。考え方を変えます。

<div id="test">
    <iframe name="testLoad" style="width:100%"></iframe>
</div>
jsイベント:

function loadPage(){
    window.open("${contextPath}/notepad/toCreate.do",'testLoad','');// testLoad iframe name
}
ボタン:

<input type="button" value=" " onclick="loadPage()" />
ボタンをクリックした時、ページをiframeにロードします。中のjsは使えます。感じがよくないです。まるでページを更新したようです。