chrisben / imgcache.js

JS library based on the File API to cache images for offline recovery (target: cordova/phonegap & chrome)
Other
826 stars 216 forks source link

How do you use ImgCache.getCachedFileUrl() ? #208

Closed michaeljcoyne closed 7 years ago

michaeljcoyne commented 7 years ago

I have tried this

ImgCache.getCachedFileUrl(that.src, function (img, newPath) {
                      //let localUrl = newPath
                       alert(newPath);
                  }, function (img) {
                      /* error callback */
                      alert('fail');
                      console.log('Failed to get path for image ' + img);

                  });

and this ImgCache.getCachedFileUrl(that.src)

cant get it to work.

michaeljcoyne commented 7 years ago

ImgCache.getCachedFileURL(that.src, function (src, dest) { alert(dest) });

bhar4t commented 5 years ago

How to get File from fileURL which is cached?