View Full Version : Can I copy text content from <iframe> to variable ?
03-14-2012, 12:59 PM
I have this code in my page
<iframe name="ff1" src="http://playerplus.co.nu/ipp.php"
how i copy the result in this iframe to text or to some variable
but from iframe not direct from the URL "http://playerplus.co.nu/ipp.php"
03-14-2012, 01:13 PM
I want to extract the contents of this page programmatically not manually
03-14-2012, 04:52 PM
03-14-2012, 05:07 PM
my friend look to my example
I want to extract the contents of this iframe to variable by ( select all & copy) or by cloning or by any way . Now I don't play with "browser security"
03-14-2012, 08:26 PM
This function assumes your iframe has an id if "myiframe".
var frameDoc=(frameObj.contentWindow || frameObj.contentDocument);
if (frameDoc.document) frameDoc=frameDoc.document;
frameDoc.body.innerHTML = "hi";
so your html would have to be
<iframe src="http://playerplus.co.nu/ipp.php" id="myiframe">
03-15-2012, 08:18 AM
As devnull69 pointed out, if the iframe url is in a different domain as the main page, you will not be able to get access to the contents of the iframe for security reasons.
03-15-2012, 10:38 AM
You mean with ajax or something? Are you trying to stop the iframe content from appearing on the page?
03-15-2012, 10:44 AM
The post from "CecilHartlely" was plain spam. Some "very funny" person(s) recently started to re-post postings from the same thread ... with no additional ad or something. This is just waste of time to the power of 10
03-15-2012, 12:40 PM
hehehe, I was puzzled how my response failed to be programmatic.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.