小编Bru*_*o V的帖子

如何在Simile时间轴中重新加载数据

我创建了一个SIMILE时间轴,它使用XML文件作为数据源,这是在调用aspx命令时由方法创建的.问题是当更新XML文件时,时间轴不会更新并显示第一次加载的数据.仅当我关闭浏览器并使用时间轴再次打开Web应用程序时,才会刷新数据.即使我转到我的Web应用程序的另一个页面,然后回到带有时间轴的页面,数据显示仍然相同.我已经确认在创建时间轴的脚本被调用之前创建/更新了XML文件,我还尝试了一些技巧,例如强制使用PageLoad(),执行Response.Redirect()并且不使用缓存.我的函数onLoad()类似于simile-widget提供的原始函数.码:

      <head>
      ...
      <meta http-equiv="pragma" content="no-cache" />
      <META HTTP-EQUIV="Expires" CONTENT="-1">
      ...
      var tl;
      function onLoad() {
        $(document).ready(function() {
            var eventSource1 = new Timeline.DefaultEventSource(0);
            var theme1 = Timeline.ClassicTheme.create();
            theme1.timeline_start = new Date(Date.UTC(2010, 0, 1));
            theme1.timeline_stop = new Date(Date.UTC(2014, 0, 1));
            var d = theme1.timeline_start;
            var bandInfos = [
            Timeline.createBandInfo({ ... }),
            Timeline.createBandInfo({ ... })
       ];
            bandInfos[1].syncWith = 0;
            bandInfos[1].highlight = true;

            // create the Timeline
            tl = Timeline.create(document.getElementById("tl"), bandInfos);
            var url = '.';

            // references in the data
            tl.loadXML("batch_data.xml", function(xml, url) …
Run Code Online (Sandbox Code Playgroud)

xml asp.net timeline simile

5
推荐指数
1
解决办法
529
查看次数

标签 统计

asp.net ×1

simile ×1

timeline ×1

xml ×1