views:

31

answers:

1

Hi, Actually i have iframe which has some important content in it ,but problem is that how can i have add content to my page in which that iframe resides. Thanks

A: 

You can get content of iframe by using following function, than you can add content in main page html.

function getContentFromIframe(iFrameName)
{

    var myIFrame = document.getElementById(iFrameName);
    var content = myIFrame.contentWindow.document.body.innerHTML;

    //Do whatever you need with the content    

}

check for more detail : http://www.roseindia.net/java/pass-value-example/pass-value-from-iframe-parent.shtml

Pranay Rana
but how to get the values of iframe
rajesh
by innerHTML you can able to access content of frame what else you want
Pranay Rana
atually what i want is that if i click any image inside iframe it will generate value and by catching that value i would be able to do some another task.this is what i want...Please respond as quick as possibleThanks
rajesh
check this might help you : http://www.roseindia.net/java/pass-value-example/pass-value-from-iframe-parent.shtml
Pranay Rana