Solve the problem of not executing page js when loading a page into a div with jquery load

  • 2020-03-30 02:07:28
  • OfStack

Jquery code:


Load the ${contextPath}/notepad/ page into the div with id of test. After loading, the js in the create page will not execute

There's no way to do this. Think of it differently:

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


function loadPage(){"${contextPath}/notepad/",'testLoad','');//TestLoad is the name property of the iframe


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

When you click the button, load the page into the iframe, the js inside is available, it doesn't feel good, just like refreshing the page...

Related articles: