我目前正在處理事件日曆。其中我必須將事件從外部txt文件添加到日曆中。我如何將關鍵值和實體鏈接到JavaScript?事件應該根據我在txt文件中給出的內容正確顯示。 預先感謝,如何將Txt文件鍵和實體值鏈接到JavaScript?
Code:
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link rel='stylesheet' href='../lib/Theme/jquery-ui.min.css' />
<link href='../fullcalendar.min.css' rel='stylesheet' />
<link href='../fullcalendar.print.min.css' rel='stylesheet' media='print' />
<script src='../lib/moment.min.js'></script>
<script src='../lib/jquery.min.js'></script>
<script src='../fullcalendar.min.js'></script>
<li src='../events.txt'></li>
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
theme: true,
header: {
right: 'prev,next today',
center: 'title',
left: 'month,agendaWeek,agendaDay,listMonth'
},
defaultDate: '2017-04-12',
navLinks: true, // can click day/week names to navigate views
eventLimit: true, // allow "more" link when too many events
events: [
{
title: ' ',
start: ' '
}
]
});
});
[Txt file][1]
[1]: https://drive.google.com/open?id=0Bw3XnR8_0rzCVEpVMlpHNm41bUk
你需要使用一些AJAX方法來讀取'events.txt' –
能否請你解釋一下?.. –
肯定的是,我用Google搜索開始使用Ajax和發現https://開頭developer.mozilla.org/en-US/docs/AJAX/Getting_Started –