Passing input value from parent window to popup window
I had made开发者_如何学C a parent window that includes a text box and hyperlink to open a PopUp Child JSP Page.
I wish to access the value entered in textbox on the Child JSP through request.getParameter method. How can I achieve this?
Just pass the value along as querystring in the URL of the popup window.
Assuming that you've a
<input type="text" id="foo">
you can pass it to the popup window as follows
var foo = document.getElementById('foo').value;
window.open('child.jsp?foo=' + encodeURIComponent(foo));
then you can access it in popup window as follows
<p>The value is ${param.foo}</p>
精彩评论