Sounds like an extremely useful improvement!
On Jul 31, 12:15 am, "Dann (Google Employee)" <d....@google.com> wrote:
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.googlec...
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.
Dann