Re: [Simile-Widgets] Detecting wether timelines has been loaded
Careful, note that the timeline object gets defined when timeline _begins_ to load; using this heuristic might lead you to invoke timeline before it _finishes_ loading the various supporting scripts. On 9/25/2012 7:54 PM, Jeremy Boggs wrote: On Sep 25, 2012, at 7:31 PM, Jeff Roehl wrote: In jQuery, I can detect whether jQuery has been loaded and what version is running with: if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.8.1') Is there something similar I can do with Simile Timelines? You can check to see if the Timeline object is undefined, or if the 'version' property on it doesn't equal a specific version. Something like this should do the same thing as the jQuery example you provided: if (window.Timeline === undefined || window.Timeline.version !== '2.3.1') If you'd like to easily see all the other properties available on the Timeline object, just do console.debug(Timeline); in a browser console. Most modern browsers have good developer tools for doing stuff like this, or have plugins available for it. (I use Chrome and its developer tools.) Best, Jeremy -- Jeremy Boggs Design Architect Digital Research and Scholarship, University of Virginia Library -- You received this message because you are subscribed to the Google Groups SIMILE Widgets group. To post to this group, send email to simile-widgets@googlegroups.com. To unsubscribe from this group, send email to simile-widgets+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en.
Re: [Simile-Widgets] Detecting wether timelines has been loaded
if (window.Timeline === undefined) { console.log(Timeline not loaded) } else { console.log(Timeline.version = + Timeline.version) } On Sep 25, 2012, at 7:31 PM, Jeff Roehl wrote: In jQuery, I can detect whether jQuery has been loaded and what version is running with: if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.8.1') Is there something similar I can do with Simile Timelines? Thanks Jeff Roehl -- You received this message because you are subscribed to the Google Groups SIMILE Widgets group. To post to this group, send email to simile-widgets@googlegroups.com. To unsubscribe from this group, send email to simile-widgets+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en.
Re: [Simile-Widgets] Detecting wether timelines has been loaded
On Sep 25, 2012, at 7:31 PM, Jeff Roehl wrote: In jQuery, I can detect whether jQuery has been loaded and what version is running with: if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.8.1') Is there something similar I can do with Simile Timelines? You can check to see if the Timeline object is undefined, or if the 'version' property on it doesn't equal a specific version. Something like this should do the same thing as the jQuery example you provided: if (window.Timeline === undefined || window.Timeline.version !== '2.3.1') If you'd like to easily see all the other properties available on the Timeline object, just do console.debug(Timeline); in a browser console. Most modern browsers have good developer tools for doing stuff like this, or have plugins available for it. (I use Chrome and its developer tools.) Best, Jeremy -- Jeremy Boggs Design Architect Digital Research and Scholarship, University of Virginia Library -- You received this message because you are subscribed to the Google Groups SIMILE Widgets group. To post to this group, send email to simile-widgets@googlegroups.com. To unsubscribe from this group, send email to simile-widgets+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en.