What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated May 07, 2008 by api.kur...@google.com
OpenSocialBestPractices  
Best practices when writing OpenSocial applications

Introduction

Try to follow these best practices when writing your applications.

Details

Reduce Latency

Check out the Latency Combat Field Manual for information on how to make your applications load faster.

Link HREFs

To use links to trigger JavaScript functions, you can use this format:

<a href="javascript:void(0);" onclick="javascript:callthis();">Click me to call this</a>

Do not use href="#"! When the user clicks on the link, the IFRAME hosting your gadget will clear its security token and subsequent opensocial calls will fail.


Comment by api.llia...@google.com, Feb 19, 2008

I'd like to see a section on caching. Between bpc=1, makeRequest and browser caching I never know if I've got the latest version!

Comment by ewmssss, Jun 12, 2008

<a href="javascript:void(0);" onclick="javascript:callthis();">Click me to call this</a>

Comment by nfp...@hotmail.com, Jun 30, 2008

What's wrong with <a onclick="callthis(); return false;">Click me to call this</a>

Comment by ksumitus, Jul 06, 2008

nothing wrong. seems people like to hide their javascript function names for whatever reasons

Comment by humbroll, Jul 23, 2008

very helpful stuff. thanks ;-)


Sign in to add a comment