/    Sign up×
Community /Pin to ProfileBookmark

read iframe html content

hello everyone

i’ trying to build a script that reads to a variable the content of an invisible iframe after being loaded from a url.
so the final result would be a variable (or several variables) with the text/html the intire file downloaded in the iframe.
is it possible to do that?

thx in advance

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@konithomimoFeb 14.2007 — If the page is not on your server then IE will give you a "permission denied" error, but FF will work.
Copy linkTweet thisAlerts:
@slaughtersFeb 14.2007 — Use the innerHTML function on the iFrames ID

i.e. var StoredHTML = document.getElementById("[I]iFrames ID[/I]").innerHTML;

Additionally as konithomimo stated. The iFrame and the main page you are doing this from need to be on the same server
Copy linkTweet thisAlerts:
@zackbloomFeb 14.2007 — This is an outdated technique for getting data from another page. Use AJAX.
Copy linkTweet thisAlerts:
@fjlemosauthorFeb 15.2007 — If the page is not on your server then IE will give you a "permission denied" error, but FF will work.[/QUOTE]

what do you mean by FF.

(why didn't i pay attention in kindergarten :rolleyes: )
Copy linkTweet thisAlerts:
@fjlemosauthorFeb 15.2007 — Use the innerHTML function on the iFrames ID

i.e. var StoredHTML = document.getElementById("[I]iFrames ID[/I]").innerHTML;

Additionally as konithomimo stated. The iFrame and the main page you are doing this from need to be on the same server[/QUOTE]


but it isn't...it's a dynamic .aspx script...

is there any way around???
Copy linkTweet thisAlerts:
@fjlemosauthorFeb 15.2007 — This is an outdated technique for getting data from another page. Use AJAX.[/QUOTE]

that seems to be the solution.

i've made some search, nevertheless can you point me some bullet prof ajax scripts/links?

thx again
Copy linkTweet thisAlerts:
@slaughtersFeb 15.2007 — This is an outdated technique for getting data from another page. Use AJAX.[/QUOTE]So, by "outdated" you mean "does not work" ? ?

I'm curious. How would AJAX help at all in getting an IFrames HTML? How could using XMLHttpRequest to send Asynchronous server side commands do you any good what so ever in this case?

P.S. FF means FireFox web browser.
×

Success!

Help @fjlemos spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...