我正在尝试在我的页面上显示事件明亮的 json,但无法正常工作,请指出正确的方向。这是我下面的代码
$(document).ready(function () { var EVENT_JSON = " http://www.eventbrite.com/json/user_list_events?app_key=MyAPPKEY&user_key=MYuserKEy&event_statuses=live,started ";
function AppViewModel() {
var self = this;
self.MaxEvents = ko.observableArray(null);
$.getJSON(EVENT_JSON , function (data) {
for (i = 0; i < data.events.length; i++) {
var rawDate = new Date(data.events[i].event.start_date.substring(0, 10));
data.events[i].event.start_date = rawDate.format("m/dd/yy");
}
self.MaxEvents(ko.mapping.fromJS(data));
// $(".description-text").find('span[style]').css("color", "blue");
});
}
// Activates knockout.js
ko.applyBindings(new AppViewModel());
});