On Fri, Mar 14, 2008 at 6:23 AM, Martin Webb <[EMAIL PROTECTED]> wrote:
> I'm stuck - and its my lack of knowledge of how shindig's rpc relay is > supposed to work that is stumping me. > > If I view http://localhost:8080/gadgets/files/container/sample2.html - > then > the 2nd of the three sample widgets supports dynamicHeight perfectly. > > If however I host just the sample2.html page from the file store (e.g. > file:///D:/workspace/shindig/javascript/container/sample2.html) *AND > *change > all the references to point back to the gadget server then dynamicHeight > stops working. What do I need to add to the following to get it to start > working again? All cross domain calls are blocked (in all browsers I'm aware of) between your local file system and a web server -- that means that rpc will only work when both the page you're viewing and the server rendering the gadget are served from web servers. As long as you always access both the parent page and the iframe page from a web server it'll work. > > > This is a small repeatable test case as I'm having problems with a > container > separate from the gadget server. > > > <!DOCTYPE html> > <html> > <head> > <title>Sample: Dynamic Height</title> > <!-- default container look and feel --> > <link rel="stylesheet" href=" > http://localhost:8080/gadgets/files/container/gadgets.css"> > <script type="text/javascript" src=" > http://localhost:8080/gadgets/js/rpc.js?c=1&debug=1"></script> > <script type="text/javascript" src=" > http://localhost:8080/gadgets/files/container/cookies.js"></script> > <script type="text/javascript" src=" > http://localhost:8080/gadgets/files/container/gadgets.js"></script> > <script type="text/javascript"> > var my = {}; > > my.gadgetSpecUrls = [ > 'http://www.google.com/ig/modules/horoscope.xml', > 'http://www.google.com/ig/modules/aue07otr.xml', > 'http://www.labpixies.com/campaigns/todo/todo.xml' > ]; > > > // This container lays out and renders gadgets itself. > > my.LayoutManager = function() { > gadgets.LayoutManager.call(this); > }; > > my.LayoutManager.inherits(gadgets.LayoutManager); > > my.LayoutManager.prototype.getGadgetChrome = function(gadget) { > var chromeId = 'gadget-chrome-' + gadget.id; > return chromeId ? document.getElementById(chromeId) : null; > }; > > my.init = function() { > gadgets.container.layoutManager = new my.LayoutManager(); > > gadgets.container.setParentUrl('http://localhost:8080/'<http://localhost:8080/%27> > ); > }; > > my.renderGadgets = function() { > for (var i = 0; i < my.gadgetSpecUrls.length; ++i) { > var gadget = gadgets.container.createGadget( > {specUrl: my.gadgetSpecUrls[i]}); > > gadget.setServerBase('http://localhost:8080/gadgets/'<http://localhost:8080/gadgets/%27> > ); > > gadgets.container.addGadget(gadget); > gadgets.container.renderGadget(gadget); > } > }; > </script> > </head> > <body onLoad="my.init();my.renderGadgets()"> > <h2>Sample: Dynamic Height</h2> > <div id="gadget-chrome-0" class="gadgets-gadget-chrome"></div> > <div id="gadget-chrome-1" class="gadgets-gadget-chrome"></div> > <div id="gadget-chrome-2" class="gadgets-gadget-chrome"></div> > </body> > </html> > > > Regards > Martin > -- > Internet Related Technologies - http://www.irt.org > -- ~Kevin

