The JavaScript client supports ClientLogin.  In order to enable it,
you should use the
setUserCredentials method on GoogleService:
http://code.google.com/apis/gdata/jsdoc/1.7/google/gdata/client/GoogleService.html#setUserCredentials

However, ClientLogin requires the ability to make cross-domain
xmlhttprequests
(similar to how this is allowed in FF extensions, google desktop,
and most non-browser javascript environments).  Choosing the
xmlhttprequest transport
happens behind the scenes, and it depends on how the JavaScript client
detects the
environment its running in.  If you're in the browser, it's likely
that AuthSub is your only option.

Eric

On Feb 7, 12:17 pm, kumar <kumaravel.kandas...@gmail.com> wrote:
> Thank you for your suggestion very helpful.
>
> However I get a following error when I use Client Login Authentication
> model, any suggestions.
>
> Error:Access to restricted URI denied
>
> CODE:
>
> (Following is the full source code... I have changed my developer key
> and password in the user credential.)
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";>
>     <head>
>         <meta http-equiv="content-type" content="application/x-www-
> form-urlencoded"/>
>         <title>My Google Data API Application</title>
>         <script src="http://www.google.com/jsapi?key=ABQ...";
> type="text/javascript"></script>
>   <script type="text/javascript">
> google.load('gdata', '1.x');
> google.setOnLoadCallback(initialize);
>
> function initialize() {
>     //alert ('inside.');
>     var scope = 'http://docs.google.com/feeds/documents/private/full';
>     var service = new google.gdata.client.GoogleService('writely',
> 'DocList-App-v1.0');
>     service.setUserCredentials("kumaravel.kandas...@gmail.com",
> "xxx");
>     service.getFeed(scope, handleFeed, handleError);
>     //alert('outside');
>
> };
>
> var handleFeed = function(response) {
>   var entries = response.feed.entry;
>   if (!entries.length) {
>     alert('You have no entries!');
>     return;
>   }
>   var html = [];
>   for (var i = 0, entry; entry = entries[i]; i++) {
>     var title = entry.title.$t;
>     html.push('<li>' + title + '</li>');
>   }
>   document.getElementById('data').innerHTML = html.join('');
>
> };
>
> var handleError = function(e) {
>
>   if (e && e.cause)  {
>       alert ('Error:' + e.cause.statusText);
>   } else if (e) {
>       alert('Error:' + e.message);
>   } else {
>       alert ('Error:');
>   }
>
> };
>
> </script>
>  </head>
>     <body>
>
> <div id="data"><!-- dynamically filled --></div>
>     </body>
> </html>
>
> On Feb 6, 12:22 pm, "Eric (Google)" <api.e...@google.com> wrote:
>
> > I posted a tip here that may get you 
> > started:http://gdatatips.blogspot.com/2008/12/using-javascript-client-library...
>
> > Eric
>
> > On Feb 6, 8:26 am, kumar <kumaravel.kandas...@gmail.com> wrote:
>
> > > I planning to use GData Spreadsheets Service using Javascript API, for
> > > which there is no API's provided.
>
> > > As anyone tried this and succeeded ?
>
> > > Example:
> > > myService = new GoogleService('wise','exampleCo-exampleApp-1');
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data Protocol" group.
To post to this group, send email to google-help-dataapi@googlegroups.com
To unsubscribe from this group, send email to 
google-help-dataapi+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to