Hi Graham, here is my source for loading events from a json object directly
from the same jsp,
I hope it will help you,
Bets regards
Laura
<html>
<head>
<script src="js/timeline-api.js" type="text/javascript"></script>
<script type="text/javascript">
var json_events={
'dateTimeFormat': 'iso8601',
'events' : [
{'start': '1898-01-01',
'title': 'Participacion de Marcelino Menéndez Pelayo en Biblioteca Nacional.
Director',
'description': ''
}
,{'start': '1881-01-01',
'title': 'Participacion de Marcelino Menéndez Pelayo en Real Academia de
Lengua. Miembro',
'description': ''
}
]};
var tl;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();
var bandInfos = [
Timeline.createBandInfo({
eventSource: eventSource,
date: "1890",
width: "100%",
intervalUnit: Timeline.DateTime.YEAR,
intervalPixels: 20,
multiple:5
})
];
tl = Timeline.create(document.getElementById("cantabria-timeline"),
bandInfos);
eventSource.loadJSON(json_events, document.location.href);
}
</script>
</head>
<body onload="onLoad();" onresize="onResize();">
Linea del tiempo de cantabria
<div id="cantabria-timeline" style="height: 150px; width:550px; border:
1px solid #aaa"></div>
</body>
</html>
-----Mensaje original-----
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] nombre de Graham Forte
Enviado el: martes, 24 de abril de 2007 18:10
Para: General List
Asunto: Re: loading events from a json object included in the same jsp
Laura,
could you tell me what your final solution was?
I was trying it with eventSource.loadJSON(json_events,
document.location.href);
but could not get it to work.
Thanks.
On 4/12/07, Laura Vogt-Schilb <[EMAIL PROTECTED]> wrote:
It worked!!
Thank you very much for your help,
Best regards
Laura
-----Mensaje original-----
De: [EMAIL PROTECTED]
[mailto: [EMAIL PROTECTED] nombre de David Huynh
Enviado el: jueves, 12 de abril de 2007 18:09
Para: General List
Asunto: Re: loading events from a json object included in the same jsp
Laura,
Instead of
tl.loadJSON(json_events, document.location.href);
try
eventSource.loadJSON(json_events, document.location.href);
David
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general