Hello!
Ive seen some solutions as to how to use ruby on rails with Timeline
but they seam outdated
I get the error from firebug ' SyntaxError: unterminated string
literal "XmlHttp: Error handling onReadyStateChange" ' and thats all.
I can see that the JSON document is returned correctly, its as if
Timeline is simply not using it...
Ideas please? Been working with this quite a while without any luck.
Its fustrating to see the events.json being downloaded in firebug but
the events dont appear..
In my rails code im simply returning a simple json document taken from
an example:
{
'wiki-url':"http://simile.mit.edu/shelf/",
'wiki-section':"Simile JFK Timeline",
'dateTimeFormat': 'Gregorian',
'events': [
{
'start':"Sat May 20 2009 00:00:00 GMT-0600",
'title':"'Bay of Pigs' Invasion",
'durationEvent':false // Notes: not "false". And no trailing
comma.
}, {
'start':"Wed May 01 2009 00:00:00 GMT-0600" ,
'end':"Sat Jun 01 2010 00:00:00 GMT-0600" ,
'durationEvent':true,
'title':"Oswald moves to New Orleans",
'description':"Oswald moves to New Orleans, and finds
employment at the
William B. Riley Coffee Company. <i>ref. Treachery in Dallas, p 320</
i>"
} ]
}
My timeline script section looks like this: Notice the tl.loadJSON
statement
<script type="text/javascript">
var tl;
function onLoad() {
var bandInfos = [
Timeline.createBandInfo({
width: "80%",
intervalUnit: Timeline.DateTime.MONTH,
intervalPixels: 100
}),
Timeline.createBandInfo({
width: "20%",
intervalUnit: Timeline.DateTime.YEAR,
intervalPixels: 200
})
];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
tl = Timeline.create(document.getElementById("my-timeline"),
bandInfos);
tl.loadJSON("/events.json",'');
}
var resizeTimerID = null;
function onResize() {
if (resizeTimerID == null) {
resizeTimerID = window.setTimeout(function() {
resizeTimerID = null;
//tl.layout();
}, 500);
}
}
</script>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---