List Info

Thread: Re: getelementbyid across frames?




Re: getelementbyid across frames?
country flaguser name
United States
2008-05-12 14:56:57


> Posted by: "caitlin_weaver" no_reply%40yahoogroups.com">no_replyyahoogroups.com caitlin_weaver
> Date: Mon May 12, 2008 9:12 am ((PDT))
>
>
> Say on frame 'one' I have this:
>
> <a id='testing'>chips</a><br>
>
> On the same page something like this works fine:
&gt;
> <a
&gt; onclick=&quot;document.getElementById('testing').innerHTML='potato';&quot;>click
> here</a>
>
> But I need to send something from frame 'two' and from there this does
>; not work:
&gt;
> <a
&gt; onclick=&quot;document.parent.frames['one'].getElementById('testing').innerHTML='potato';&quot;>click
> here</a>
>
> What am I doing wrong?
&gt;
> The reason I have two frames is that one is refreshing frequently to
> fetch new data from a remote site. The idea is for javascript to
> update the contents of the other frame without reloading the page.

You can't update the DOM tree of one document from another document that's on a
different server.

cheers

jon.

>
> Thanks a lot,
>; - Cait
>;

--
This message has not been scanned for viruses.

Since I do not use a Microsoft operating
system or software, and use only plaintext
for email, there is little need for me to do so.

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )