“下一个”是参数错误或丢失

发布于 2024-10-19 20:44:30 字数 1461 浏览 3 评论 0原文

我正在使用谷歌日历 API 将事件导出到谷歌日历,当用户登录到我的网络应用程序时,他创建一个事件并将同一事件导出到谷歌日历,这是基本要求。我已使用此代码进行身份验证

<body>
<div id="panel"></div>
<script type="text/javascript">
var myService;


google.load("gdata", "1");
google.setOnLoadCallback(getMyFeed);

function logMeIn() {
      scope = "http://www.google.com/calendar/feeds";
        var token = google.accounts.user.login(scope);
    }

function setupMyService() {
     myService = new google.gdata.calendar.CalendarService('GoCalender');
     logMeIn();
}
function handleMyFeed(myResultsFeedRoot) {
      alert("This feed's title is: " + myResultsFeedRoot.feed.getTitle().getText());
    }

    function handleError(e) {
      alert("There was an error!"+ e.cause ? e.cause.statusText : e.message);

    }
function getMyFeed() {
    setupMyService();
     var feedUrl = "https://www.google.com/calendar/feeds/[email protected]/private/full";
    myService.getEventsFeed(feedUrl, handleMyFeed, handleError);
}
</script>
<img src="google-app-engine1.png" style="postion:absoulute; width:50px"></img>

虽然我没有在此处指定创建单个事件代码,但我不会向用户授权那里的谷歌帐户。谷歌服务器给出了一个错误,内容是:

“无法显示您请求的页面。另一个网站正在请求访问您的谷歌帐户,但发送了格式错误的请求。请联系您在收到请求时尝试使用的网站此消息通知他们错误,详细错误消息如下:

“下一个”参数错误或丢失。

有什么问题请帮助我找到解决方案。我是 google api 的新手。

I am using google calendar api to export an event to google calendar, when the users logins to my web app he creates an event and exports the same event to google calendar, this a basic requirement. I have used this code for the authentication

<body>
<div id="panel"></div>
<script type="text/javascript">
var myService;


google.load("gdata", "1");
google.setOnLoadCallback(getMyFeed);

function logMeIn() {
      scope = "http://www.google.com/calendar/feeds";
        var token = google.accounts.user.login(scope);
    }

function setupMyService() {
     myService = new google.gdata.calendar.CalendarService('GoCalender');
     logMeIn();
}
function handleMyFeed(myResultsFeedRoot) {
      alert("This feed's title is: " + myResultsFeedRoot.feed.getTitle().getText());
    }

    function handleError(e) {
      alert("There was an error!"+ e.cause ? e.cause.statusText : e.message);

    }
function getMyFeed() {
    setupMyService();
     var feedUrl = "https://www.google.com/calendar/feeds/[email protected]/private/full";
    myService.getEventsFeed(feedUrl, handleMyFeed, handleError);
}
</script>
<img src="google-app-engine1.png" style="postion:absoulute; width:50px"></img>

though I have not specified the create single event code here, I am not to auth user to there google accounts. The google server is giving a error which says --

"The page you have requested cannot be displayed. Another site was requesting access to your Google Account, but sent a malformed request. Please contact the site that you were trying to use when you received this message to inform them of the error. A detailed error message follows:

The "next" parameter was bad or missing."

What is the problem kindly help me to get the solution for this. I am a novice to google apis.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

锦爱 2024-10-26 20:44:30

您是否从以 file:// 开头的 url 运行此命令?如果是这样,它将无法工作,您需要一个本地网络服务器,因此网址以 http://localhost/ 开头,请阅读在安装一个时。如果您已经有一个网络服务器,请确保您的文件的路径/url 不包含空格或其他需要编码的字符 - 我发现这也可能会导致问题。

Are you running this from a url beginning with file:// ? If so it will not work, you need a local web server so the urls begin something like http://localhost/, read up on installing one. If you already have a web server, make sure the path/url to your file does not contain spaces or other characters that need encoding - I've found this can also cause problems.

殊姿 2024-10-26 20:44:30

当我从本地磁盘加载的 javascript 访问日历 API 时,我刚刚遇到了同样的问题。将文件发布到 Web 服务器并使用 http 协议访问它们解决了这个问题。我猜测 API 会尝试在下一个参数中附加原始主机名,但是当它重定向时,如果您从本地文件运行它,则不会有任何主机名(显然)。

I just ran into the same problem when accessing the Calendar API from javascript loaded from my local disk. Publishing the files to a web server and accessing them using the http protocol solved the problem. I'm guessing the API tries to append the origin host name in the next parameter, but when it is redirecting, and if you run it from a local file there won't be any host name (obviously).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文