开发者

How do I create liferay iframe from jsp

开发者 https://www.devze.com 2023-04-09 19:09 出处:网络
Here is a scenario. I am working on a small project and in this, I will be forming a URL base开发者_运维百科d on some condition checks. When the final URL is ready ( in JSP), I have to invoke the life

Here is a scenario. I am working on a small project and in this, I will be forming a URL base开发者_运维百科d on some condition checks. When the final URL is ready ( in JSP), I have to invoke the liferay iframe and pass this URL to it so that as the JSP is loaded. It should load the newly created liferay iframe with the URL which I have formed. How to do this in the flow ? Is there any means through which liferay iframe can be created ? (Something from liferay taglib)

Thanks

-Aj


Got it. Did something like this.

<script>
function show(which) {
var hide = new Array();
hide = document.getElementsByName(which);
for (i=0; i<hide.length; i++) {
hide[i].style.display = 'inline';
}
}
function hide(which) {
var hide = new Array();
hide = document.getElementsByName(which);
for (i=0; i<hide.length; i++) {
hide[i].style.display = 'none';
}
}
</script>
<style type="text/css">
iframe { display: none; }
</style>
<b>Google</b>
<input type="button" value="Show" onclick="show('iframe');">
<input type="button" value="Hide" onclick="hide('iframe');">
<iframe src='http://www.google.com' width='100%' height='100%' scrolling='yes'       name='iframe'></iframe>

Now I can use the show and hide, as I need and use it.

These buttons can be used to maximize and minimize the iframe based on the need and more than 1 iframe can be used in a page too.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号