我正在尝试通过 Ajax 进行设置,这就是我目前所拥有的。我一直试图弄清楚这一点,但似乎无法点击。
function getFunction()
{
$(".cals").click(function()
{
$.get("http://events.cs50.net/api/1.0/calendars?campus=GSD&output=json", function(data, status)
{
var response = "<h3>GSD Calenders</h3>\n";
response = response + '<ul data-role="listview" data-inset="true" data-filter="true">\n';
var jsonObject = JSON.parse(data);
for (var i = 0; i < jsonObject.length; i++) {
var calendar = jsonObject[i].calname;
response = response
+ '<li><a href="#item">'
+ calendar
+ '</a></li>\n'; }
response = response + '</ul>';
$('#calendars').html(response);
});
});
}