function loadForm() {
alert("hai");
document.getElementById("divid").innerHTML="<jsp:include page='publisherform.jsp'></jsp:include>";
}
<a name="publisher" href=# onclick="loadForm()" >PublisherManagement</a>
Here, jsp:include is working at page load itself…. Can any one say the reason? how to load it on click?
The answer is you cant because the jsp code is processed on the server before the html and JS is returned to the client. Once it is rendered you can no longer process JSP code.
To communicate back to the server you need to use Ajax.
Alternatively you can use an IFrame to load another page’s content.