I have two forms which are defined in this way
Home.jsp:-
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
@import "../Script/dojo-1.10/dijit/themes/claro/claro.css";
</style>
<script type="text/javascript">
dojoConfig = {
isDebug: true,
parseOnLoad : true
}
</script>
<script type="text/javascript" lang="JavaScript" src="../Script/dojo-1.10/dojo/dojo.js"></script>
<script type="text/javascript">
require(["dojo/parser","dijit/form/Button",
"dojo/domReady!"],function(parser){
//parser.parse();
alert("From Require");
});
function getWelcomeJsp(){
var loadResponse = dojo.byId("loadResponse");
dojo.xhrPost({
url:"Welcome.jsp",
handleAs:"text",
load:function(data){
dojo.style(loadResponse,"display","block");
loadResponse.innerHTML = data;
return data;
},
error:function(err){
alert("error"+err);
}
});
}
</script>
</head>
<body class="claro">
<table>
<tr><td valign="bottom">
<a href="Welcome.jsp">This Is Hyperlink</a>
</td></tr>
<tr>
<td>
<label for="empId">EmpId:</label>
<input id="empId" data-dojo-type="dijit/formTextBox"
type="text"/>
</td></tr><tr><td>
<button data-dojo-type="dijit/form/Button" id="buttonId" onclick="getWelcomeJsp();">Send</button>
</td></tr></table>
<div id="loadResponse"></div>
</body></html>
Welcome.jsp:-
<!DOCTYPE html>
<html><head>
<style type="text/css">
@import "../Script/dojo-1.10/dijit/themes/claro /claro.css";</style>
<script type="text/javascript" lang="JavaScript" src="../Script/dojo-1.10/dojo/dojo.js"> </script>
<script type="text/javascript" lang="JavaScript">
require(["dojo/parser","dojo/ready"],function(parser,ready){
dojo.ready(function(){
parser.parse();
alert("From Ready");
});
});
function myfunction(){
alert("from welcomedd JSP");
}
</script></head>
<body class="claro" onload="myfunction();">
This Is Welcome JSP
<button id="responseButton" data-dojo-type="dijit/form /Button" onclick="myfunction();">Response Button</button>
</body></html>
Yes,when am clicking on the hyper link in Home.jsp using dojo 1.9 version, Then Welcome.jsp is getting populated very well and the ready function in Welcome.jsp is also getting called and all dojo widgets are getting compiled .
Here comes the problem when am trying to load the Welcome.jsp through an ajax call from Home.jsp .
Welcome.jsp is getting loaded but ready function and onload function in Welcome.jsp is not getting called what can be the problem in ajax response. Am just unable to understand problem that am facing here please let me know any solution for this.