Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 使用对Google日历API的ajax调用分析错误_Jquery_Ajax_Google Calendar Api - Fatal编程技术网

Jquery 使用对Google日历API的ajax调用分析错误

Jquery 使用对Google日历API的ajax调用分析错误,jquery,ajax,google-calendar-api,Jquery,Ajax,Google Calendar Api,我正在尝试调用google日历API。它在API资源管理器中工作,但在javascript(jquery)中失败 在api资源管理器上,它返回一个错误,表示timeMax丢失(并且没有问题) ajax调用返回一个解析错误,我不明白为什么 "message": "Parse Error" 一年多以后,我看到了你的帖子。我只是把我所有的参数像这样放在URL中。我使用jsonp和HTTPGET,因为我正在对只读日历提要进行简单的解析。我使用moment.js格式化所有时间 var https = '

我正在尝试调用google日历API。它在API资源管理器中工作,但在javascript(jquery)中失败

在api资源管理器上,它返回一个错误,表示timeMax丢失(并且没有问题)

ajax调用返回一个解析错误,我不明白为什么

"message": "Parse Error"

一年多以后,我看到了你的帖子。我只是把我所有的参数像这样放在URL中。我使用jsonp和HTTPGET,因为我正在对只读日历提要进行简单的解析。我使用moment.js格式化所有时间

var https = 'https://www.googleapis.com/calendar/v3/calendars/' + calendarId + '/events?    singleEvents=true&orderBy=startTime&sortOrder=ascending&timeMin=' + moment(startMin).format() + '&timeMax=' + moment(startMax).format() + '&key=' + key;
$.ajax({
    url: https,
    dataType: 'jsonp',
    type: "GET",
    success: function (response) {
        processFeed(response);
    }
});

尝试删除
?键=“+apikey
从您的url,并通过
数据
属性传递它。同样的错误,没有任何更改这里有一个完全工作的url,在我们的网站上为我提供只读提要。复制并检查它,也许它会揭示一些关于你正在构建的URL的信息。请注意,您必须更新并且>我认为moment.js可能是解决方案。我做了一把小提琴来看看你的时间2013-01-30T00:00:00.000Z作为输出会是什么样子:。它似乎将时间更改为2013-01-29T18:00:00-06:00没有任何更改。也许问题出在钥匙上。我将回顾如何获得它(已经很久了)
"message": "Parse Error"
var https = 'https://www.googleapis.com/calendar/v3/calendars/' + calendarId + '/events?    singleEvents=true&orderBy=startTime&sortOrder=ascending&timeMin=' + moment(startMin).format() + '&timeMax=' + moment(startMax).format() + '&key=' + key;
$.ajax({
    url: https,
    dataType: 'jsonp',
    type: "GET",
    success: function (response) {
        processFeed(response);
    }
});