0

I have code - unchanged from yesterday - that just stopped working. Odd, I know. But I've looked at it over and over. And nothing in my code has changed.

I am using the Javascript API Client library to load the 'plus' API. As of last night (7/25/2013), this code was working fine. Now, I get the gapi.client and call gapi.client.load and the callback is never getting called.

In my index.html, I have the following:

<script type="text/javascript" src="https://apis.google.com/js/client.js?onload=onLoadCallback"></script>

My onLoadCallback() function looks like this:

function onLoadCallback() {
    try{
        console.log( "gapi.client: " + gapi.client  );
        gapi.client.load('plus', 'v1', function() {
                     console.log('plus loaded!');
                     });
    }
    catch(err) {
        console.log( "onLoadCallback error: " + err.message );
    }
}

This callback never gets called (and I've checked for syntax errors so if there are any above it was during my copy/paste into StackOverflow).

When I load this code in Chrome and look at the console: I see the following:

gapi.client: [object Object] 

followed by:

Uncaught SyntaxError: An invalid or illegal string was specified. 
rs=AItRSTMqSYNvDyDFNs8wjPrZc5pR-M_27Q:83

And, when clicking on that reference to rs=....:83, it seems to be in the middle of some code that isn't my code. Looks like something to do with the Google API Javascript library.

I should also note that, if I comment out the gapi.client.load line, then this error doesn't appear on the Javascript console. So, it definitely seems to be a result of the call to gapi.client.load.

Has anyone else experienced any unusual behavior or changes to the GAPI Javascript client library that would cause this error?

Thanks for any help or insight.

[NOTE: Tagged as Google-App-Engine because this also happens to be in an app accessing an App Engine and asking for the user's ID to access it. And there isn't a StackOverflow tag for Google-API-Client-Library yet.]

[Edit: I should note that the original app is in PhoneGap. The comments on looking in the Javascript console below are from when I was trying to debug the app in a browser since the console logging from the PhoneGap app was less than satisfactory.]

4

1 回答 1

1

我们这些受此影响的 PhoneGap 开发人员正在等待确认这已在 Google API Javascript 客户端级别得到确认和修复。然而,一夜之间,gapi.client.load 又开始工作了。

该问题已在以下位置输入和跟踪:https ://code.google.com/p/google-api-javascript-client/issues/detail?id=95

于 2013-07-30T11:50:18.347 回答