2010-08-30 28 views

回答

2

在這裏你去:

alert(JSON.stringify(object)); 

這一切,我可以給你,因爲你甚至不提供的代碼示例...

+0

<腳本類型= '文本/ JavaScript的'> \t \t \t $(文件)。就緒(函數(){ \t \t \t \t $( '#日曆')。fullCalendar( { \t \t \t \t \t編輯:真, \t \t \t \t \t事件:「<?PHP的回聲$這 - >的baseUrl(); ?> /實體/約會/列表/」, \t \t \t \t \t eventDrop:函數(事件,三角洲){ \t \t \t \t \t \t警報(event.title + '感動' +三角洲+'天\ n '+ \t \t \t \t \t \t \t '(或許應該更新數據庫)'); \t \t \t \t \t}, \t \t \t \t \t裝載:功能(布爾){ \t \t \t \t \t \t如果(布爾)$( '#裝載')顯示(); \t \t \t \t \t \t else $('#loading')。hide(); \t \t \t \t \t} \t \t \t \t}); \t \t \t}); \t \t – Chris 2010-09-03 19:19:14

+1

那是什麼?這不是JSON。 – Lekensteyn 2010-09-04 08:23:14

0

這個JSON:

[ 
    {     
     "id": "1", 
     "title": "All Day Event ", 
     "allDay": true, 
     "start": "1283378679", 
     "end": null, 
     "url": "#", 
     "className": "event-type-one", 
     "editable": "true", 
     "source": null, 
     "description": "Sed enim et mauris purus nisi auctor, amet integer rhoncus, dapibus augue scelerisque." 
    } 

]

響應字符串將是

$('#calendar').fullCalendar({ 
     events: "(your path to json)/events.json" 
     alert(event.id); 
     alert(event.title); 
     alert(event.allDay); 
}); 

相關問題