That would do it. If you reparent an iframe it forces it to reload. Very annoying, as dojo and many other applications re-parent menu contents and other things when they are not visible ( I think for a11y reasons). This causes gadgets that may exist in these areas to reload. Kind of a crappy situation. I think every browser behaves like this, even if the iframe element is inserted back into the dom it was originally from. (This happens under the covers by just moving the iframe within the dom structure)
If possible, it would be good to set up your chrome before the render. Maybe when constructing the gadget-site if you are using the CommonContainer. From: daviesd <[email protected]> To: <[email protected]>, Date: 10/26/2011 04:18 PM Subject: Re: document.write Ya, so what I was doing was kind of backwards. I called navigateGadget and then tried to wrap the iframe node with my chrome. I was using the YUI Node wrap method, but I think it clones the node, thus my 2 iframe calls. I am now wrapping the element I pass to navigateSite BEFORE the call and then looking for that DIV and decorating it with the chrome. Thanks, doug On 10/26/11 3:42 PM, "Dan Dumont" <[email protected]> wrote: > Could you share more of your current gadget minus the document.write? > > Maybe put it on http://pastebin.com/ so we can try loading it locally? > > > > From: daviesd <[email protected]> > To: shindig <[email protected]>, > Date: 10/26/2011 03:00 PM > Subject: Re: document.write > > > > I apologize. It has nothing to do with document.write (I thought this was > the culprit, but it just made it more visible in the browser). I see this > double ifr request even if my gadget does NOTHING (other than stub out a > default view). Ideas why I would see the ifr request twice? > > doug > > > On 10/26/11 1:57 PM, "daviesd" <[email protected]> wrote: > >> I¹m having something strange happen. If I use document.write in my > gadget it >> seems to have issues loading >> >> http://locahost:8080/opensocial/gadgets/ifr?url=... >> >> It just spins and spins (I see 2 ifr requests one after the other, one >> succeeds the other spins ‹ the gadget renders but there is an > outstanding >> network request). >> >> Here¹s my code >> >> var params = {}; >> params[gadgets.io.RequestParameters.CONTENT_TYPE] = >> gadgets.io.ContentType.TEXT; >> gadgets.io.makeRequest(url, function(result) { >> document.write('gadgets.io: ' + result.errors); >> }, params); >> >> If I remove the document.write or just switch it to an alert it works > fine. >> >> Ideas? >> >> Doug > > > >
