Update on this. There seems to be a whole series of problems with the code I posted in http://www.hayriverti.org/seeds.xml Here is what I have found out so far. The iframe in http://www.hayriverti.org/seed-library can be seen by itself here http://8g70vehon7uhaojqv0bshkq7honkrikq-a-sites-opensocial.googleusercontent.com/gadgets/ifr?url=http://www.hayriverti.org/seeds.xml&container=enterprise&view=default&lang=en&country=ALL&sanitize=0&v=4fd4b5b0d6da245a&libs=core&mid=65&parent=http://www.hayriverti.org/seed-library# It is a bit easier to see the generated HTML this way. Working with alert(); and the JavaScript error console I found out that // window.SimileAjax_onLoad = loadExhibit; //this didn't run loadExhibit but this one does poll(window, [ "includeData" ], loadExhibit);
With the SimileAjax_onLoad in place both loadExhibit and onEverythingLoaded code was not being executed. In loadExhibit // SimileAjax.includeJavascriptFiles(document, "", [ " http://api.simile-widgets.org/exhibit/3.1.0rc3/exhibit-api.js" ]);//throws an error but this does not window.Exhibit.includeJavascriptFiles(document, "", [ " http://api.simile-widgets.org/exhibit/3.1.0rc3/exhibit-api.js" ]); This line might not be needed as http://api.simile-widgets.org/exhibit/3.1.0rc3/exhibit-api.js should have already loaded with loadJS(" http://api.simile-widgets.org/exhibit/3.1.0rc3/exhibit-api.js"); In onEverythingLoaded window.database = Exhibit.Database.create(); does not create a database or at one point I was getting a Javascript null value for window.database . In http://api.simile-widgets.org/exhibit/3.1.0rc3/scripts/data/database.js it looks like there should be a "type" parameter. Exhibit.Database.create = function(type) { if (typeof Exhibit.Database[type] !== "undefined") { return new Exhibit.Database[type](); } else { // warn? return new Exhibit.Database._LocalImpl(); } }; What should this type be? //window.database.loadDataLinks(); I get an error of window.database.loadDataLinks is not a function when it is not commented out. I could not find loadDataLinks in the Exhibit list of .js files. Has this been changed in the 3.x versions? George Adams On Fri, Aug 15, 2014 at 2:19 PM, George Adams <[email protected]> wrote: > I am getting back into Exhibit after a number of years. > My new Exhibit needs to run as a Goggle Gadget so it doesn't have access > to the <head> of the web page. With the help of this group I was able to do > this several years ago by adding a bunch of javascript which loaded the > needed items into the head of the page. > This page works with Exhibit 2 > http://www.hayriverti.org/local-directory-map > It has the code for the Exhibit in this xml file > http://www.hayriverti.org/localDirectory.xml > > The new Exhibit can be seen here as a plain HTML page with stuff loaded in > the <head> > http://hayriv.com/seeds.html it works > Here is another version that does all the loading in the body and is based > on the Local Directory javascript. > http://hayriv.com/seedsxml.html This also works. > > This page takes the code of the body of the above page and wraps it in the > Google Gadget module XML. > http://www.hayriverti.org/seed-library > The XML file is at http://www.hayriverti.org/seeds.xml > > This page loads the html OK and seems to load the Exhibit .js and .css > files but the data file isn't loaded or is loaded after the data is moved > to the <head> > > There is a line in the javascript that polls to see if Exhibit is loaded. > poll(window, [ "Exhibit" ], onEverythingLoaded); > Is there a way to poll to see if the data is loaded? > > I tried this without success. > poll(window, [ "Exhibit","dataLink" ], onEverythingLoaded); > > Just as a note I was having similar trouble with the file at > http://hayriv.com/seedsxml.html which oddly would work when there was an > window.alert() added to the code after the includeData(" > https://spreadsheets.google.com/feeds/list/0AkgOV8gxmgPadGV3bTVxREZvb05jNUhxaGNQZ2lFZ2c/od6/public/values?alt=json-in-script > "); > My guess was that this delayed the rest of the script enough to load the > data. After moving > includeData(" > https://spreadsheets.google.com/feeds/list/0AkgOV8gxmgPadGV3bTVxREZvb05jNUhxaGNQZ2lFZ2c/od6/public/values?alt=json-in-script"); > earlier in the series of script steps it worked without fail and without > the alert() in the code. > > Any help would be appreciated. > George Adams > -- You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/simile-widgets. For more options, visit https://groups.google.com/d/optout.
