One step ahead!
I made this change in PHP:
$html .= " tl = Timeline.create(document.getElementById('$divID'),
bandInfos);" . PHP_EOL;
$html .= " var jsonObject = JSON.parse($eventSource);" . PHP_EOL;
$html .= " tl.loadJSON(jsonObject, document.location.href);" .
PHP_EOL;
that give me this HTML:
var tl; function onLoad() { var eventSource = new
Timeline.DefaultEventSource(); var bandInfos = [
Timeline.createBandInfo({ eventSource: eventSource,
width: "80%", intervalUnit: Timeline.DateTime.MONTH,
intervalPixels: 100 }), Timeline.createBandInfo({
eventSource: eventSource, overview: true,
width: "20%", intervalUnit: Timeline.DateTime.YEAR,
intervalPixels: 200 }) ]; bandInfos[1].syncWith =
0; bandInfos[1].highlight = true; tl =
Timeline.create(document.getElementById('tl1'), bandInfos);
var jsonObject =
JSON.parse({"dateTimeFormat":"Gregorian","events":[{"title":"Vessel
Two","start":"Thu, 20 Mar 2014 00:00:00 +1030","durationEvent":true,"end":"Sun,
23 Mar 2014 00:00:00 +1030","color":"#0000FF"},{"title":"Vessel
Two","start":"Wed, 23 Apr 2014 00:00:00
+0930","durationEvent":false,"color":"#0000FF"}]});
tl.loadJSON(jsonObject, document.location.href); }
Now the timeline load without error messages, but no events are displayed.
How can I sort out this issue?
Thank you.
Il giorno martedì 29 aprile 2014 19:51:44 UTC+2, massiws ha scritto:
>
>
> I think problem is how to pass json object from PHP to JS/HTML; I tryed
> different solutions, but I can't find a solution.
>
>
--
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.