Requirements Description: Two JSP pages, the parent page needs the content of the child page, but the child page is hidden, specifically, the child page is a series of templates, the parent page to get through the ID of these templates, do not want to import through the <include> mode, because if the template too much, the entire parent page is too large , loading slowly, the following two scenarios, I do not know if there is no solution to this problem.
1, through the Ajax Way
Implementation procedure: Through the AJAX request to the child page, the child page obtains the parameter ID to use the Java and the JS variable interaction, returns the required template information
Disadvantages: To convert JS variables to Java variables more troublesome, need to use form table forms submit, and JSP Java script is running on the server side, need server-side resource overhead, and increase the number of interactions
2, through the introduction of IFRAME
Implementation process: Use the IFRAME to introduce a subpage, and then get the template you need by $ (iframe.contents (). Find ("#" +id) [0]). Val ().
Disadvantage: Not sure whether the IFRAME can be delayed loading, if you want to <include> the same as the entire page to import, this method is not OK.