欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解決用jquery load加載頁(yè)面到div時(shí),不執(zhí)行頁(yè)面js的問(wèn)題

 更新時(shí)間:2014年02月22日 09:36:11   作者:  
這篇文章主要介紹了解決用jquery load加載頁(yè)面到div時(shí),不執(zhí)行頁(yè)面js的問(wèn)題。需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助

jquery代碼:

復(fù)制代碼 代碼如下:

$(function(){
$("#test").load("${contextPath}/notepad/toCreate.do");
}

加載 ${contextPath}/notepad/toCreate.do 頁(yè)面到id為test的div中,加載完成之后,create頁(yè)面中的js不會(huì)執(zhí)行

這種方式?jīng)]辦法實(shí)現(xiàn),換個(gè)思路:

復(fù)制代碼 代碼如下:

<div id="test">
    <iframe name="testLoad" style="width:100%"></iframe>
</div>

js事件:
復(fù)制代碼 代碼如下:

function loadPage(){
    window.open("${contextPath}/notepad/toCreate.do",'testLoad','');// testLoad為iframe的name屬性
}

按鈕:
復(fù)制代碼 代碼如下:

<input type="button" value="加載" onclick="loadPage()" />

點(diǎn)擊按鈕時(shí),加載頁(yè)面到iframe中,里面的js是可以使用的,感覺(jué)不太好,就像是刷新頁(yè)面了一樣...

相關(guān)文章

最新評(píng)論