George,
Please find the corrected files attached. They seem to work for me in
Firefox 3 and IE 8 RC1 on Windows.
David
George Adams wrote:
> David,
> That javascript was more complex than I can understand. I have
> attached both my html file and JSON file. I get no error with these
> but no display either.
> I did change the line
> SimileAjax.
> includeJavascriptFiles(document, "", [
> "http://static.simile.mit.edu/exhibit/api-2.1.0/exhibit-api.js
> <http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js>"
> ]);
>
> to
>
> SimileAjax.
> includeJavascriptFiles(document, "", [
> "http://static.simile.mit.edu/exhibit/api-2.1.0/exhibit-api.js
> <http://static.simile.mit.edu/exhibit/api-2.1.0/exhibit-api.js>"
> ]);
>
>
> The line
> <link type="application/json" rel="exhibit/data"
> href="ComputerHistory.js">
> is still in the header and I get a validation error when it is placed
> in the body.
>
> Any help you can give would be appreciated.
>
> On Sun, Feb 15, 2009 at 12:47 PM, David Huynh <[email protected]
> <mailto:[email protected]>> wrote:
>
>
> George Adams wrote:
> > I would like to be able to create a chunk of code that could be
> > dropped into the body of a web page where I have no access to the
> > <head> to include the needed JSON and Exhibit js files.
> > In a html page that works moving the following code into the body
> > doesn't work.
> >
> > <link type="application/json" rel="exhibit/data"
> > href="ComputerHistory.js">
> > <script
> > src="http://static.simile.mit.edu/exhibit/api-2.0/exhibit-api.js"
> > type="text/javascript"></script>
> > <script
> >
>
> src="http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js"
> > type="text/javascript"></script>
> >
> > Details: Error: Failed to derive URL prefix for Simile Exhibit Time
> > Extension code files
> > and Error: Exhibit is not defined
> >
> > I also tried
> > <script type="text/javascript">
> > var loadJS = function(file) {
> > var script = document.createElement('script');
> > script.src = file;
> > script.type = 'text/javascript';
> > document.getElementsByTagName('head')[0].appendChild(script);
> > };
> >
> loadJS("http://static.simile.mit.edu/exhibit/api-2.0/exhibit-api.js");
> >
>
> loadJS("http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js");
> > </script>
> > without success.
> >
> > It looks like the error is generated here.
> > var url = SimileAjax.findScript(document, "/time-extension.js");
> > if (url == null) {
> > SimileAjax.Debug.exception(new Error("Failed to derive
> URL prefix for Simile Exhibit Time Extension code files"));
> >
> > return;
> > }
> >
> >
> It's a bit more complex... Try something like this
>
> var loadTimeExtension = function() {
> window.SimileAjax_onLoad = onEverythingLoaded;
> SimileAjax.includeJavascriptFiles(document, "", [
>
> "http://static.simile.mit.edu/exhibit/extensions-2.1.0/time/time-extension.js
>
> <http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js>"
> ]);
> };
> var loadExhibit = function() {
> window.Exhibit_urlPrefix =
> "http://static.simile.mit.edu/exhibit/api-2.1.0/";
> window.Exhibit_parameters = "?autoCreate=false";
> window.SimileAjax_onLoad = loadTimeExtension;
> SimileAjax.includeJavascriptFiles(document, "", [
> "http://static.simile.mit.edu/exhibit/api-2.1.0/exhibit-api.js
>
> <http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js>"
> ]);
> };
> window.SimileAjax_onLoad = loadExhibit;
> window.SimileAjax_urlPrefix =
> "http://static.simile.mit.edu/ajax/api-2.1.0/";
>
> loadJS("http://static.simile.mit.edu/ajax/api-2.1.0/simile-ajax-api.js");
>
> function onEverythingLoaded() {
> ... all good here ...
> }
>
> David
>
>
>
>
> >
>
> ------------------------------------------------------------------------
>
>
> Computer History
>
>
> ,
> Where:
> -
>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" 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/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---
Title: Computer History
Computer History
ComputerHistory.js
Description: JavaScript source