Home > Web Front-end > JS Tutorial > body text

Solve the problem of page js not being executed when using jquery load to load a page into a div_jquery

WBOY
Release: 2016-05-16 16:58:44
Original
1007 people have browsed it

jquery code:

Copy code The code is as follows:

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

Load ${contextPath}/notepad/toCreate. do page to the div with the ID of test. After the loading is completed, the js in the create page will not be executed

This method cannot be implemented, so try another way:

Copy the code The code is as follows:





js event:
Copy code The code is as follows:

function loadPage(){
window.open("${contextPath}/notepad/toCreate.do",'testLoad','');// testLoad is the name attribute of iframe
}

button :
Copy code The code is as follows:



When the button is clicked, the page is loaded into the iframe. The js inside is usable, but it doesn't feel very good. It's like refreshing the page. Same...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template