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!

Referring to info in an IFRAME

Status
Not open for further replies.

justjim

Programmer
Oct 22, 2002
13
US
I have an IFRAME on my page and am trying to info from it.

I get and "Acces Denied error when i call the following
function:

the first function works with no problem but the second one
that references the IFRAME is driving me crazy.

// ***********************************************
// THIS FUNCTION WORKS FINE for Main document
// ***********************************************
function printRange() {
var range = document.body.createTextRange();
if (range!=null) {
document.txtHtml.PagetxtHTML.value=""
document.txtHtml.PagetxtHTML.value=range.htmlText;
}
}
// ***********************************************
// THIS FUNCTION FAILS for the IFRAME
// ***********************************************
function printIFrameRange() {
var range = document.frames["weatherPage"].document.body.createTextRange();
if (range!=null) {
document.txtHtml.bulktext.value=""
document.txtHtml.bulktext.value=range;
}
}
// ***********************************************


I cant read anything from the IFRAME even its location
document.frames["weatherPage"].document.location.href

What am I doing wrong in referring to the IFRAME?

Tkx - Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top