简体   繁体   中英

load jsp page from javascript

I have 3-4 jsp pages, and iam calling them in each other.I could have kept all the code in one page but then it was getting to complex to handle,so broke the page in 3-4 different pages.And iam successfully able call them one after the other.But the problem is when i call these two pages the page just overlap and the length of the page increases.

<other code above this>
<%@ include file="northern_content.jsp" %>
<%@ include file="southern_content.jsp" %> 
<No code after these files are included>

I want that if i click a particular option then either one of them (according to the choice of click) should be loaded. How can i achieve this.

Very Simple

<a href="northern_content.jsp">Northern Content</a>

This way, you click on a page, you will be taken to that page. is this what you are looking for?

Or you can write this on a button click or any other event handling, if you have a form

onclick="document.forms[0].action = 'northern_content.jsp'

Here you use javascript to change the action of the form

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM