Cool, thanks again for the help. I am confused by the last paragraph but I think it's because you're looking at the code at the first URL rather than the second one:
http://code.google.com/webtoolkit/tutorials/1.6/Xsite.html The code at that URL uses 'window' instead of $wnd. So I think this does pollute the window namespace. No? -Mike On Jul 20, 6:41 pm, Thomas Broyer <t.bro...@gmail.com> wrote: > On 20 juil, 22:26, mike <mikebannis...@gmail.com> wrote: > > > Darth, ...ahh, great thanks. > > > I got to $wnd to work for code in the cross-site communication > > tutorial. I think the problem was that I was using "document and $wnd" > > rather than "$doc and $wnd". I haven't completely worked out in my > > head why the former wouldn't work but it seems sensible that you would > > need to make sure it's all either happening on the host page or all in > > the iframe. > > You add your script node to 'document' (which lives in 'window') but > you define the callback function in $wnd. When the script loads, it > calls a function called "callback<ID>" (where ID is a counter); in > JavaScript, this is equivalent to calling window.callbackID (because > 'window', and window.window, and window.window.window, and etc. is the > "global object"); but as I said before, the function doesn't exist, as > it has been actually defined in $wnd. > > Incidentally, if you <add-linker name="xs" /> in your gwt.xml, it'll > work, because in this case $wnd == window and $doc == document. > > > Any guess why the tutorial uses window/document rather than $wnd/ > > $doc ? > > That way, it doesn't "pollute" the window name space (only the $wnd > name space, which is only ever used by your GWT compiled code), as it > uses "window[something] = ..." constructs (incidentally, if you <add- > linker name="xs" />, it *will* pollute the window namespace). COol --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---