English 中文(简体)
模拟时间表。 SML档案问题
原标题:simile timeline. problem with XML file

我正在通过网络寻找时间线。 我发现,我喜欢:。 http://www.simile-widgets.org/timeline/

因此,我试图追随他们的辅导,见:

I following the tutorial so the code is the same but here it goes:

<script>
   var tl;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();

var bandInfos = [
Timeline.createBandInfo({
    eventSource:    eventSource,
    date:           "Jun 28 2006 00:00:00 GMT",

    width:          "70%", 
    intervalUnit:   Timeline.DateTime.MONTH, 
    intervalPixels: 100
}),
Timeline.createBandInfo({
    eventSource:    eventSource,
    date:           "Jun 28 2006 00:00:00 GMT",

    width:          "30%", 
    intervalUnit:   Timeline.DateTime.YEAR, 
    intervalPixels: 200
})
  ];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;

tl = Timeline.create(document.getElementById("my-timeline"), bandInfos);
Timeline.loadXML("test.xml", function(xml, url) { eventSource.loadXML(xml, url); });

}

var resizeTimerID = null;
function onResize() {
if (resizeTimerID == null) {
    resizeTimerID = window.setTimeout(function() {
        resizeTimerID = null;
        tl.layout();
    }, 500);
}
}

</script>
<body onload="onLoad();" onresize="onResize();">
<div id="my-timeline" style="height: 150px; border: 1px solid #aaa"></div>
</body>

测试。

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?xml-stylesheet type="text/css" href="/TBDBsite/media/timeline.css"?>
 <data>
<event 
    start="May 28 2006 09:00:00 GMT"
    end="Jun 15 2006 09:00:00 GMT"
    isDuration="true"
    title="Writing Timeline documentation"
    image="http://simile.mit.edu/images/csail-logo.gif"
    >
    A few days to write some documentation for <a href="http://simile.mit.edu/timeline/">Timeline</a>.
    </event>

<event 
    start="Jun 16 2006 00:00:00 GMT"
    end="Jun 26 2006 00:00:00 GMT"
    title="Friend s wedding"
    >
    I m not sure precisely when my friend s wedding is.
    </event>

<event 
    start="Aug 02 2006 00:00:00 GMT"
    title="Trip to Beijing"
    link="http://travel.yahoo.com/"
    >
    Woohoo!
    </event>
 </data>

I m与LOAD XML有问题,我将其XML的范例档案保存在模板的同一地方,但当我重读第1页时,我发现这一错误:

Failed to load data xml from test.xml
NOT FOUND

I would like to known if anyone knowns why or to solve this. My idea was to save my data into some XML file but perhaps it isn t the best solution.
If someone has better ideias to make time lines I would also appreciate.

感谢!

最佳回答
问题回答

答复相当晚,但错误产生于数据档案,包括Xml声明。 时间范围只包括从开始的xml

<data>




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签