p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript How-To (http://p2p.wrox.com/forumdisplay.php?f=87)
-   -   How to read the text of an IFRAME (http://p2p.wrox.com/showthread.php?t=58931)

gaddam.naveenreddy June 11th, 2007 02:34 AM

How to read the text of an IFRAME
 
Hi,

I used IFRAME to write the sometext in a HTML page. I want to read that text from that IFRAME and used it at other place.

Can any one tell me the code to read that text from an IFRAME.



Naveen Reddy Gaddam (Nani)

joefawcett June 12th, 2007 02:03 AM

Well assuming the frames are both populated from the same web domain and use the same protocol then you should be able to grab the document,
Code:

var doc = top.frames["framebname"].document
Then use regular DHTML:
Code:

alert(doc.body.substr(0, 100));
--

Joe (Microsoft MVP - XML)


All times are GMT -4. The time now is 02:58 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.