detecting OpenSocial??

0 views
Skip to first unread message

estanley

unread,
Nov 29, 2007, 5:55:21 PM11/29/07
to OpenSocial - OpenSocial API Definition
I apologize if this question has been answered in a previous
discussion. If it has, I'd greatly appreciate a response with a link
to the solution.

So, I'm trying to have my gadget/widget detect whether it is in an
OpenSocial container or not. I've been trying to check to see if the
opensocial namespace exists, but haven't had much luck with that
approach--i'm guessing this is because different containers may
implement OpenSocial differently(?) So does anyone know of a standard
way to detect OpenSocial?

And here's my test function, in case I'm going about this all wrong:

function hasOpenSocial(){
if( !!opensocial ){
return true;
}else{
return false;
}

Thanks,
Erica

Arne Roomann-Kurrik (Google)

unread,
Nov 30, 2007, 6:27:34 PM11/30/07
to OpenSocial - OpenSocial API Definition
Hello Erica,

That code should be fine (you probably don't need the !! part
though). The JS spec lives in the opensocial namespace, so if it is
defined, then the container should be supporting OpenSocial calls.

~Arne

Rick Measham

unread,
Dec 1, 2007, 12:27:01 AM12/1/07
to opensoc...@googlegroups.com
estanley wrote:
> function hasOpenSocial(){
> if( !!opensocial ){
> return true;
> }else{
> return false;
> }

This is exactly the equivalent of:

function hasOpenSocial(){
return !!opensocial
}

Which won't work if opensocial isn't defined. Try:

function hasOpenSocial(){
return typeof opensocial != 'undefined'
}

Cheers!
Rick Measham

aak...@live.com

unread,
Dec 1, 2007, 3:01:26 PM12/1/07
to opensoc...@googlegroups.com, api.k...@google.com

After so much sufferings, debuggings, orkut "no donut" pages i have
finally created a opensocial application by which you can give tags to
your friends like tagged.com, MyBlogLog, you can view it action at my
orkut page- http://sandbox.orkut.com/Profile.aspx?uid=12042369521039845627
you can add this app from this url- http://enext.biz/aks/tags.xml ,
please leave feedback, suggestions and errors..
However i got a lot of questions regarding this app-
*How do i change edit settings button to gadget owner only, or some
prefs to show only when viewer is the owner
*Whats the procedure to get the app in application directory
*Will orkut universal search the gadget cache?
*i am not able to run this in IE7 or safari for windows,works
flawlessly on firefox 2,3b1. it  gets stuck on getting persons profile
url, IE7 has a JS error "get(..) is null or not an object" , safari
asks for password for gmodules servers.
A  button for "add this app to your profile" seems to be must have in
later opensocial api versions..



> Date: Fri, 30 Nov 2007 15:27:34 -0800
> Subject: [OpenSocial] Re: detecting OpenSocial??
> From: api.k...@google.com
> To: opensoc...@googlegroups.com

Arne Roomann-Kurrik (Google)

unread,
Dec 3, 2007, 2:00:59 PM12/3/07
to OpenSocial - OpenSocial API Definition
Hey Aakash,

Please start a new thread for this discussion - the topic you
responded to was about detecting whether OpenSocial was defined or
not.

Thanks,
~Arne



On Dec 1, 12:01 pm, <aak...@live.com> wrote:
> After so much sufferings, debuggings, orkut "no donut" pages i have finally created a opensocial application by which you can give tags to your friends like tagged.com, MyBlogLog, you can view it action at my orkut page-http://sandbox.orkut.com/Profile.aspx?uid=12042369521039845627you can add this app from this url-http://enext.biz/aks/tags.xml, please leave feedback, suggestions and errors.. However i got a lot of questions regarding this app- *How do i change edit settings button to gadget owner only, or some prefs to show only when viewer is the owner *Whats the procedure to get the app in application directory *Will orkut universal search the gadget cache? *i am not able to run this in IE7 or safari for windows,works flawlessly on firefox 2,3b1. it gets stuck on getting persons profile url, IE7 has a JS error "get(..) is null or not an object" , safari asks for password for gmodules servers. A button for "add this app to your profile" seems to be must have in later opensocial api versions..
>
> > Date: Fri, 30 Nov 2007 15:27:34 -0800> Subject: [OpenSocial] Re: detecting OpenSocial??> From: api.kur...@google.com> To: opensoc...@googlegroups.com> > > Hello Erica,> > That code should be fine (you probably don't need the !! part> though). The JS spec lives in the opensocial namespace, so if it is> defined, then the container should be supporting OpenSocial calls.> > ~Arne> > > > On Nov 29, 2:55 pm, estanley <erica.stan...@gmail.com> wrote:> > I apologize if this question has been answered in a previous> > discussion. If it has, I'd greatly appreciate a response with a link> > to the solution.> >> > So, I'm trying to have my gadget/widget detect whether it is in an> > OpenSocial container or not. I've been trying to check to see if the> > opensocial namespace exists, but haven't had much luck with that> > approach--i'm guessing this is because different containers may> > implement OpenSocial differently(?) So does anyone know of a standard> > way to detect OpenSocial?> >> > And here's my test function, in case I'm going about this all wrong:> >> > function hasOpenSocial(){> > if( !!opensocial ){> > return true;> > }else{> > return false;> > }> >> > Thanks,> > Erica> _________________________________________________________________
>
> Connect and share in new ways with Windows Live.http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_...

Martin Selva

unread,
Dec 7, 2007, 2:12:25 AM12/7/07
to opensoc...@googlegroups.com
Hi Aakash,

I can answer some of you queries.

>> 1.Whats the procedure to get the app in application directory
- Its not yet  disclosed from  Orkut's End but it will be very much similar to Facebook app directory.

>> i am not able to run this in IE7 or safari for windows,works
flawlessly on firefox 2,3b1. it  gets stuck on getting persons profile
url, IE7 has a JS error "get(..) is null or not an object" , safari
asks for password for gmodules servers.
- All orkut APIs works Firefox. Final APIs will be working on all browsers
Reply all
Reply to author
Forward
0 new messages