handling iframes from javascript

Posted by Chinnu21 under ASP.NET on 4/30/2007 | Views : 4355 | Status : [Member] | Replies : 3
handling iframes from javascript and complete details about iframes and using the same.
main differences between iframes and frames.
advantages and disadvantages.




Responses

Posted by: Sagarp on: 3/26/2010 [Member] Bronze

Up
0
Down
Hi friend,

u can use this Article in that prove code example


http://www.dyn-web.com/tutorials/iframes/


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Chinnu21, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/3/2012 [Member] Bronze | Points: 25

Up
0
Down
hi

Refer
http://www.dyn-web.com/tutorials/iframes /

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Chinnu21, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 11/28/2007 [Member] Starter

Up
0
Down
I think I can cover little part of your question. If you want to handle Iframe using JavaScript following code may help you in understanding.


// Parameter details
// t = target page
// target = div id under which iframe will be placed
function OpenMagicFunctionPage(t, target)
{
var iframeHTML = '';
if (isObject(document.getElementById('FramMe1s')) == null) //if first time then create object
{
var vHide = '<p align="right" style="margin-top:0pt;margin-bottom:0pt;background-color: #FFFF00"><a href="javascript:hideMagicLink()"><b>X </b></a></p>';
iframeHTML='<iframe id="FramMe1s" border="0" frameborder="0" marginwidth="0" marginheight="0" style="width:500;height:400;overflow:auto;"></iframe>';
document.getElementById(target).innerHTML += vHide + iframeHTML;
}

if (parent.document.getElementById(target).style.display=='none')
{
parent.FramMe1s.location.replace(t);
parent.document.getElementById(target).style.display='';
}
else
{
parent.document.getElementById(target).style.display='none';
}
}


Above code will dynamically create an iframe on the fly and set its src property to its passed parameter (t).

Frames are used to separate the pages into several views where iframe are used to render a block from different page inside the parent page.

Regards,
Raja, USA

Chinnu21, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response