4 messages in com.googlegroups.google-gadgets-apiComing Soon: Changes to _IG_FetchCont...
FromSent OnAttachments
Dann (Google Employee)30 Jul 2007 16:14 
Justin McConnell30 Jul 2007 17:15 
Dann (Google Employee)30 Jul 2007 17:49 
Bonstio31 Jul 2007 01:08 
Subject:Coming Soon: Changes to _IG_FetchContent()
From:Dann (Google Employee) (d.@google.com)
Date:07/30/2007 04:14:58 PM
List:com.googlegroups.google-gadgets-api

Hey gadget developers!

Here's another heads up for a subtle change in the API.

We recently discovered inconsistent behavior when calling _IG_FetchContent() in different browsers. When the response returns 0 bytes, Safari returns 'null' while Firefox and IE both return an empty string.

This inconsistent behavior can be confusing and burdensome as it requires you to check the response differently in different browsers. Therefore, we'll be changing this behavior soon where _IG_FetchContent() will always return at least an empty string even when no response is retrieved. This enables you to create a standardized check to determine if a response was retrieved. For example:

_IG_FetchContent(url, function(response) { if (!response) { alert('Empty response'); return; } ... });

If you want to see the different response types returned, load this test gadget in Firefox/IE and Safari: http://gmodules.com/ig/ifr?url=http://daniel-feedback-gadgets.googlecode.com/svn/trunk/test/test_fetchcontent_invalidurl.xml&nocache=1

This change shouldn't break existing gadgets, but then again, past experience tells us never to assume this. Please let us know if you see any problems with the change.

Thanks!

Dann