Thanks for this great post! :-)

It's a good thing you brought up point #1, it can be frustrating to many 
developers. It's always a good idea to include a version number in your XML 
to make sure you are debugging the right thing. We also cache other 
application assets, so if you just updated a graphics file that you are 
using, you may not see changes immediately.

Another relevant point is that you should always do error handling on the 
callbacks:

function callback(data) {
   if (data.hadError()) {
      // handle error
   }
   ...
}

Why? Because if you don't check and try to operate on the data anyway, you 
may get strange 'null' and 'undefined' values. I remember spending a few 
hours scratching my head at this when I had just started learning 
OpenSocial. So the bottom line is: always check for errors!

By the way, you can get the error message like this:

data.getErrorMessage()

And the individual error messages for each of your requests like this:

data.get('your_id').getErrorMessage()

Another very important point I'd like to emphasize is #2: use a Javascript 
console or debugger so you can see if you have any syntax errors or runtime 
errors!

Again, congrats on the great post and keep up the good work! :)

-
Bruno Oliveira (Google)

-- 
You received this message because you are subscribed to the Google Groups 
"orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com.
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en.

Reply via email to