2012-07-02 37 views
0

我正在使用DHTMLX生成日曆視圖。DHTMLX調度程序不會加載數據

我已經按照DHTMLX網站關於如何加載日曆的教程。是的,這是完美的工作,但數據不會加載。

從DHTMLX網站此示例代碼

function init() { 
    scheduler.config.multi_day = true; 

    scheduler.config.xml_date="%Y-%m-%d %H:%i"; 
    scheduler.init('scheduler_here',new Date(2010,7,5),"week"); 
    scheduler.load("../common/events2010.xml"); 
} 

在哪裏的init()時身體已加載功能負載

<體的onload = 「INIT();」 >

我用jquery更改事件onload。它看到運行正確

$(document).ready(function(){ 
    AnyTime.picker("BookDateStart", 
    { format: "%z-%m-%d %H:%i:00", firstDOW: 1 }); 

    AnyTime.picker("BookDateFinish", 
    { format: "%z-%m-%d %H:%i:00", firstDOW: 1 }); 

    scheduler.config.multi_day = true; 
    scheduler.config.xml_date="%Y-%m-%d %H:%i"; 
    // scheduler.config.readonly=true; 
    scheduler.init('scheduler_here',new Date(2010,7,5),"week"); 
    scheduler.load("../common/events2010.xml"); 
}); 

但是當我更改xml位置的數據將不會加載。我確信我輸入的xml位置是正確的。

我的錯誤是什麼?

回答

0

但是當我改變XML位置

如果要移動的xml文件到不同的服務器也不會因爲跨域安全的工作。

雖然xml文件與html頁面位於同一服務器上,但數據必須正確加載。

+0

不,我使用localhost進行測試。我已經解決了這個問題。我清除了緩存。 Thx爲您的評論。 – Kenjiro

相關問題