Sunday, November 17, 2013

Linking to image in sdcard PhoneGap [android help]


Linking to image in sdcard PhoneGap



I have a saved image in android "mnt/sdcard/offlineImages" folder. The image is named img_0.jpg.


Now I want to display this image on a html page via javascript.


I tried the following two cases.


CASE ONE WHICH WORKS.



html


javaScript
document.getElementById('anImg').src = "file:///mnt/sdcard/offlineImages/img_0.jpg";


CASE TWO, WHICH DOESN'T WORK.



html


javascript
var anImg = new Image();
anImg.src = "file:///mnt/sdcard/offlineImages/img_0.jpg";
document.getElementById("img_wrap").appendChild(anImg);


Read more

stackoverflow.comm



No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...