Passing variable to timeline on timeline javascript

17 views
Skip to first unread message

hanif fikri

unread,
Jun 11, 2012, 4:12:03 PM6/11/12
to wp-simile-timeline
hey everyone!

so i've been developing a dynamic event loded from a jsonized PHP
page,

i wrote the jsonized php code by passing a php variable, soon which
conditioned
if the variable is empty or not will have a result, for example down
below is the
json result if the variable i pass contain nothing,


{"wiki-url":"http:\/\/simile.mit.edu\/shelf","wiki-section":"Simile
Cubism Timeline","dateTimeFormat":"Gregorian","events<br>":[

{"start":"Sun, 24 Jul 2011 00:00:00 +0800","end":"Mon, 30 Jan 2012
00:00:00 +0700","durationEvent":true,"description":"masih
kosong","title":"Amanda Bynes PT. We Connect You"},

{"start":"Mon, 14 May 2012 00:00:00
+0800","end":null,"durationEvent":false,"description":"masih
kosong","title":"John Dhoe PT Akira Sukindo"},

{"start":"Thu, 01 Mar 2012 00:00:00
+0700","end":null,"durationEvent":false,"description":"masih
kosong","title":"Amanda Bynes PT. Trakindo Utama"}]}


my problem is, how do you pass a php variable that had been recieved
from a post method a form action
to the jsonized PHP url

here it goes:

$tahun=$_POST["eyear"]; --> i wrote this outside javascript with php
tag <?php ?>

How do you pass the above variable to the jsonizep php file that i
named "timelinejson.php"..
i'm imagining the way we apply in basic html/php "thetargetpage.php?
thevariabe"+<?php $variable; ?>

tl = Timeline.create(document.getElementById("xxx"), bandInfos);
tl.loadJSON('timelinejson.php?'+(new Date().getTime()),
function(json, url) {

eventSource.loadJSON(json, url);



Much Regard Niphyon
Reply all
Reply to author
Forward
0 new messages