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