The JSP parent page passes parameters to the child page and receives examples

  • 2021-01-03 21:01:04
  • OfStack

1. The parent page passes parameters to the child page
 
//JavaScript code  
$.ajax({ 
type:"POST", 
uri:"../student/studentInfo.action", 
data:{ 
"date":date, 
"stuNo":stuNo 
}, 
success:function(data){ 
var params = "?date="+date+"&stuNo="+stuNo; 
var action = '../../page/studentInfo.jsp?'+params; 
dojo.byId("student").src = action; 
} 
}); 

 
<iframe src="../../page/studentInfo.jsp" id="student" ></iframe> 

2. The child page accepts the parameters of the parent page
 
var params = { 
'date':'{param.date}', 
'stuNo':{param.stuNo} 
}; 

Related articles: