I have a timeline javascript that gets the data from xml.
I managed to write the xml generator. Timeline, when it feeds from the xml, works fine.
But when I connect the xml generator instead of XML file it fails. I checked, the generator outputs correct data(I saved it to XML file and checked the timeline plugin)
//WORKS:
Timeline.loadXML("./example.xml", function(xml, url) { eventSource.loadXML(xml, url); })
//DOES NOT WORK
Timeline.loadXML("./TimelineReportXML.php", function(xml, url) { eventSource.loadXML(xml, url); })
What is wrong? Javascript can’t get the XML from file that has the .php extension? What are my options?
From PHP you need to add the XML content type header :
This line must be included in your PHP script prior to any output.