93
rated 0 times
[
94]
[
1]
/ answers: 1 / hits: 6055
/ 11 Years ago, sat, january 11, 2014, 12:00:00
MyServlet forwards to Mypage.jsp as
request.getRequestDispatcher(/pages_homepage.jsp?value=+count).forward(request, response);
where count is an integer value generated
Below is my JSP code(Mypage.jsp),
<body onload=getPage('<%request.getParameter(value);%>')>
<div id=app></div>
</body>
Below is my javascript code,
function getPage(match){
var arr = new Array();
var ele = document.getElementById('app');
for(var i=0;i<match;i++){
var newdiv = document.createElement(label);
newdiv.id = arr[i];
newdiv.value=Page;
ele.appendChild(newdiv);
}
}
What I want is that, I want 'Page' to be displayed 'match' number of times. But I'm not being able to do so by the above code. Their might be something wrong with my js code. Can anyone suggest me any corrections?
Thanks in advance.
More From » jquery