4 messages in com.googlegroups.bloggerdevRe: Check Login| From | Sent On | Attachments |
|---|---|---|
| Ashutosh | 07 Feb 2008 04:03 | |
| Jeff Scudder | 08 Feb 2008 16:02 | |
| Ashutosh | 10 Feb 2008 20:30 | |
| Jeff Scudder | 11 Feb 2008 17:51 |
| Subject: | Re: Check Login![]() |
|---|---|
| From: | Jeff Scudder (j....@google.com) |
| Date: | 02/08/2008 04:02:36 PM |
| List: | com.googlegroups.bloggerdev |
On Feb 7, 4:04 am, Ashutosh <vyas...@gmail.com> wrote:
Hi
I am new to JS API for Blogger. Currently What I did was simple went to Edit HTML for my blog and inserted the script for developer key and load data in the Head section as below:
<script type="text/javascript" src="http://www.google.com/jsapi?key=developer_key"> </script>
<script type="text/javascript"> google.load("gdata", "1"); </script>
Then I have a button which has the following code:
<script type="text/javascript"> function checkLogin() { scope = "http://www.blogger.com/feeds"; var token = google.accounts.user.checkLogin(scope);
alert(token);}
</script> <input value="Work In Progress" onclick="javascript:checkLogin()" type="button"/>
My problem is that whether I am logged in to blogger or not, it always shows a BLANK alert.
Can anybody help me out on this.
THanks Ashutosh
Hi Ashutosh,
I think the reason that google.accounts.user.checkLogin will return an empty string (which evaluates as false in if statements, loops, etc.) if you are not authenticated. If you are authenticated, you should receive the token back from google...checkLogin. Does it work if you include a call to google.accounts.user.login(scope)?
Thank you,
Jeff




