Here's a hopefully quick one for those with more Sencha Touch / Ext / JS experience than I have. How would I programmatically test for the existence of a remote resource, say an image? In other words how do I forestall an HTTP 404 before it happens and perform some default action, say swapping in a default image?
Here is what I'm currently doing (the catch(e) block is never hit):
albumArtArea.setTpl('<img class="cover_art" src="{iconUrl}"/>');
try {
albumArtArea.setData(itemData);
}
catch (e) {
// this block is never executed
// 404 for missing album art; use the generic image
itemData.iconUrl = "resources/images/img_music_generic.png";
albumArtArea.setData(itemData);
}