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!

Referencing an IFRAME's Properties ???

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
 
I'm no expert and can't help you with the main question, but maybe you will be able to take something from this.

I have an iframe which I called IFrame2 and to get the href of the page being shown in the iframe I used

document.frames.IFrame2.location.href

Hope this was of some help to you
 
i tried your suggestion ...
with :
document.frames.wPage.location.href

and received a Permission denied error message ..

I am Using IE 6 ... are you using Netscpe 6 or 7 ??

regards Jim
 
I'm using IE6, works fine for me, think that the permision denied error is due to something else.

I haven't yet tested it on netscape, if it doesn't work I shall cry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top