We’re trying to display a graph (.gif) from another site inside our phonegap app. Just adding the img tag with the src set causes a timeout for the entire app. Trying to add the image on page load…
var img = new Image();
var source = <site address based on graphSwitch>;
$(img).attr('src',source).load(
function () {
$('#div' + graphSwitch).empty();
$('#div' + graphSwitch).append(img);
alert("Image Added");
});
has only resulted in nothing being displayed. The only help I’ve been able to find has been to make sure the site is added to externalHosts (for phonegap 0.9.3) which I’ve already done and change the timeout, which I also tried but didn’t help.
What would be an acceptable way to load images from another website in phonegap?
Well, it seems that with a few more variations I was able to locate the problem. Neither the android simulator for eclipse or the iphone simulator in xcode worked… but actually putting it on an ipod did.
If someone knows how to get it to work all the time and not just on a device I’ll switch the answer over to them.
EDIT: It does look like it was our network. Although it still isn’t working on eclipse that isn’t on the network that was blocked.