I have an jsp from which i call the iframe called iframe1 .
<iframe id="iframe1" style="display:none;" height="430" width="675" src="Myjps.jsp" ></iframe>
Now i have a parameter called myActualValue, which i am getting from a bean . Now i have to pass this parameter to iframe1 . How can I do it ?
Kindly help .
I have an jsp from which i call the iframe called iframe1 .
<iframe id="iframe1" style="display:none;" height="430" width="675" src="Myjps.jsp" ></iframe>
Now i have a parameter called myActualValue, which i am getting from a bean . Now i have to pass this parameter to iframe1 . How can I do it ?
Kindly help .
Share Improve this question asked Nov 21, 2012 at 15:26 The Dark KnightThe Dark Knight 5,58513 gold badges58 silver badges104 bronze badges 1-
1
Assuming the parameter is available before the above
<iframe>
line is rendered by the JSP, why not just add it with thesrc
attribute asMyjps.jsp?param=value
– techfoobar Commented Nov 21, 2012 at 15:28
2 Answers
Reset to default 4Pass it in the URL
src="Myjps.jsp?myval=something"
Inside first jsp:
<iframe id="iframe1" style="display:none;" height="430" width="675" src="Myjps.jsp?myActualValue=<%= myActualValue %>" ></iframe>
Inside Iframe1 (Myjps)
<script>
var myActualValue = location.search.substring(1).split("=")[1];
</script>