Actualy, It dosnt work in firefox :-/

Opera9.6 and IE6 test fine.

Firefox3 however, dosnt.

Interestingly, it dosnt return an error. No exception occors, this
simple returns a null;

/*-{
          var c;
          c = $wnd.parent.document.getElementsByTagName("H1")[0].innerText;
          return c;
        }-*/;

(whereas the other browsers return the content of H1 correctly).

Does Firefox have some sort of security stoping things in frames
looking out ? :-/

Its clearly getting the parent doc, because else the try/catch
wouldn't pass correctly.
And I dont see how H1 can be expressed any different on the html.


On Oct 29, 7:05 pm, darkflame <[EMAIL PROTECTED]> wrote:
> I stand corrected!
>
> It did work fine.
> I was testing it in Opera, using its ability to edit webpages live and
> see the changes in realtime.
> It seems however, that despite the changes being visible on screen,
> javascript still referances the original page outside of an iframe,
> thus it wasnt working.
>
> Cheers again!
>
> On Oct 29, 6:07 pm, "Ian Bambury" <[EMAIL PROTECTED]> wrote:
>
>
>
> > I only tried it in IE and it worked in that for me.
> > Alternatively, (I haven't tried this) create a JS method in the parent and
> > call it from JSNI - maybe that will be allowed - what are you using?
>
> > Ian
>
> >http://examples.roughian.com
>
> > 2008/10/29 darkflame <[EMAIL PROTECTED]>
>
> > > dosnt seem to work.
>
> > > My testing HTML is just;
>
> > > <Body>
> > > <h1> test test test </h1>
> > > <iframe src="(link to gwt page here)" width="100%" height="500px"></
> > > iframe>
> > > </Body>
>
> > > And my code is;
>
> > > public static native void testWindow()
> > >                /*-{
> > >                  $wnd.alert("test");
>
> > >  $wnd.alert("text="+$wnd.parent.document.getElementsByTagName("H1")
> > > [0].innerText);
>
> > >                }-*/;
>
> > > When activating that function, the first alert "test" appears, but the
> > > following one does not.
> > > I put it in a try/catch loop and it gave me a
>
> > > "Security error: attempted to read protected variable"
>
> > > exception.
>
> > > On Oct 29, 3:40 pm, "Ian Bambury" <[EMAIL PROTECTED]> wrote:
> > > > Hi Thomas,
> > > > Put an H1 in the parent document and try this:
>
> > > > alert($wnd.parent.document.getElementsByTagName("H1")[0].innerText);
>
> > > > Ian
>
> > > >http://examples.roughian.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to