My apologies in advance if I'm posting this in the wrong place. If
that's the case, please let me know where this question should be
asked.
I'm developing an application that will read Timeline data from a
mySQL database using PHP. At the moment (just to get things working)
we're reading the data and then writing it to a temporary file (called
'myfile.js' in this example), with the data in JSON format.
The current way Timeline loads the data is through this function:
tl.loadJSON("./data/myfile.js?"+ (new Date().getTime()), function
(json, url) {
eventSource.loadJSON(json, url);
Rather than write to a file and then read it back in, we'd like to
read from the database then and insert it directly into a javascript
variable, something like:
<?php
// php code for reading data from the database goes here,
// and the data gets returned as the PHP var "$timeline_data"
?>
<script type='text/javascript'>
// printed via PHP, the data is stuffed into the javascript var 'foo'
var foo = <?php echo $timeline_data; ?>;
The problem is that I have no idea what javascript variable the data
in 'myfile.js' is supposed to end up in. What would I replace the
current data file loading lines with to insert the returned data
directly into a javascript var so that TimeLine can use it?
In other words, what Javascript variable does the data loaded through
these two lines end up in:
tl.loadJSON("./data/myfile.js?"+ (new Date().getTime()), function
(json, url) {
eventSource.loadJSON(json, url);
I thank you in advance for any help you may be able to offer.
LDM
[email protected]
(Timeline n00b)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---