|
|
problem accessing document in generated iframe
Hi,
I'm having some trouble accessing a form in a generated iframe. I can
only access the frame using the document.getElementById() method (the
frame is not in the frames array since it is dynamically generated)
and then I cannot seem to then get access to the document inside the
frame.
//this returns a frame element
frm = document.getElementById("frame1");
//returns undefined
alert(frm.document);
ultimately I am trying to access a form inside the frame.
Any ideas?
|
|
0
|
|
|
|
Reply
|
sadiewms (8)
|
12/27/2007 6:38:01 AM |
|
sadie said the following on 12/27/2007 1:38 AM:
> Hi,
>
> I'm having some trouble accessing a form in a generated iframe. I can
> only access the frame using the document.getElementById() method (the
> frame is not in the frames array since it is dynamically generated)
> and then I cannot seem to then get access to the document inside the
> frame.
>
> //this returns a frame element
> frm = document.getElementById("frame1");
>
> //returns undefined
> alert(frm.document);
>
> ultimately I am trying to access a form inside the frame.
>
> Any ideas?
Put the IFrame into the page hard-coded. Then hide it using CSS. Then,
instead of creating it dynamically, simply un-hide it.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
|
|
0
|
|
|
|
Reply
|
Randy
|
12/27/2007 7:57:40 AM
|
|
That's not possible with the logic of my app. I'm trying to use the
iFrame within a google maps infoWindow, so there isn't anywhere to
hard-code it in the page. Is there any other way to access the frame
document??
On Dec 27, 3:57 pm, Randy Webb <HikksNotAtH...@aol.com> wrote:
> sadie said the following on 12/27/2007 1:38 AM:
>
>
>
> > Hi,
>
> > I'm having some trouble accessing a form in a generated iframe. I can
> > only access the frame using the document.getElementById() method (the
> > frame is not in the frames array since it is dynamically generated)
> > and then I cannot seem to then get access to the document inside the
> > frame.
>
> > //this returns a frame element
> > frm = document.getElementById("frame1");
>
> > //returns undefined
> > alert(frm.document);
>
> > ultimately I am trying to access a form inside the frame.
>
> > Any ideas?
>
> Put the IFrame into the page hard-coded. Then hide it using CSS. Then,
> instead of creating it dynamically, simply un-hide it.
>
> --
> Randy
> Chance Favors The Prepared Mind
> comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
> Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
|
|
0
|
|
|
|
Reply
|
sadie
|
12/27/2007 9:48:43 AM
|
|
That's not possible with the logic of my app. I'm trying to use the
iFrame within a google maps infoWindow, so there isn't anywhere to
hard-code it in the page. Is there any other way to access the frame
document??
On Dec 27, 3:57 pm, Randy Webb <HikksNotAtH...@aol.com> wrote:
> sadie said the following on 12/27/2007 1:38 AM:
>
>
>
> > Hi,
>
> > I'm having some trouble accessing a form in a generated iframe. I can
> > only access the frame using the document.getElementById() method (the
> > frame is not in the frames array since it is dynamically generated)
> > and then I cannot seem to then get access to the document inside the
> > frame.
>
> > //this returns a frame element
> > frm = document.getElementById("frame1");
>
> > //returns undefined
> > alert(frm.document);
>
> > ultimately I am trying to access a form inside the frame.
>
> > Any ideas?
>
> Put the IFrame into the page hard-coded. Then hide it using CSS. Then,
> instead of creating it dynamically, simply un-hide it.
>
> --
> Randy
> Chance Favors The Prepared Mind
> comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
> Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
|
|
0
|
|
|
|
Reply
|
sadie
|
12/27/2007 9:49:24 AM
|
|
Ok, I found a work around where I don't need to access the frame
document from the parent page, but I'm still curious if there was
anyway to do it and if not why?
btw, thanks for the quick reply Randy.
On Dec 27, 5:48 pm, sadie <sadie...@gmail.com> wrote:
> That's not possible with the logic of my app. I'm trying to use the
> iFrame within a google maps infoWindow, so there isn't anywhere to
> hard-code it in the page. Is there any other way to access the frame
> document??
>
> On Dec 27, 3:57 pm, Randy Webb <HikksNotAtH...@aol.com> wrote:
>
> > sadie said the following on 12/27/2007 1:38 AM:
>
> > > Hi,
>
> > > I'm having some trouble accessing a form in a generated iframe. I can
> > > only access the frame using the document.getElementById() method (the
> > > frame is not in the frames array since it is dynamically generated)
> > > and then I cannot seem to then get access to the document inside the
> > > frame.
>
> > > //this returns a frame element
> > > frm = document.getElementById("frame1");
>
> > > //returns undefined
> > > alert(frm.document);
>
> > > ultimately I am trying to access a form inside the frame.
>
> > > Any ideas?
>
> > Put the IFrame into the page hard-coded. Then hide it using CSS. Then,
> > instead of creating it dynamically, simply un-hide it.
>
> > --
> > Randy
> > Chance Favors The Prepared Mind
> > comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
> > Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
|
|
0
|
|
|
|
Reply
|
sadie
|
12/27/2007 9:58:19 AM
|
|
|
4 Replies
100 Views
(page loaded in 0.107 seconds)
|
|
|
|
|
|
|
|
|