Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Read document properties or HTML content across domains?

Status
Not open for further replies.

gbdru2

IS-IT--Management
Jan 3, 2003
4
GB
I need to be able to detect either the document properties or the HTML of a frame page and then invoke a function based on what I find..

eg below is the outline code for what happens..
frameset loads, triggers done() which writes data to B.
what I need is to detect whats actually in frame D so that I can trigger different functions based on what comes back..
(msn.com will not always come back because of timeouts, network problems etc) I'd like to capture the errors etc

either document properties or by searching content (eg read html in frame D, if find 404 then assume its page not found error


cheers
D

<html>
<script>
function done(){
PD.document.open()
PD document write() .. blah blah
PD.document.close
}
</script>
<frameset name=A rows=&quot;60%,*&quot;>
<frame name=&quot;B&quot; src=&quot;&quot;>
<frameset NAME=C rows = &quot;100%,*&quot; onLoad=&quot;done()&quot;>
<FRAME NAME=D SRC=&quot; <FRAME NAME=E SRC=&quot;&quot; >
</frameset>
</frameset>
 
for security reasons, you cannot access window/document properties of pages that are not on your domain.

you're probably getting &quot;access denied&quot; script errors, right? =========================================================
if (!succeed) try();
-jeff
 
Hi,

no, I haven't tried it yet because I was aware of the security restrictions..

been mulling over how to get round it first
 
off the top of my head, i know you can use java (not javascript) to read a URL as a textstream...you could probably use jsp to read a webpage into a local file, then display that local file...voilà: now you can access the window
=========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top