You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ $.fn.cacheImages.defaults.debug = true; // Globally Set
20
20
**fail*: callback when the caching is not possible (unable to reach the file, or unable to cache file)
21
21
**storagePrefix*: Used to prefix the URL in the localStorage key [default: 'cached']
22
22
**url*: Set the image URL to be cached for the selector [default: null]
23
+
**forceSave*: Will force the call to cache to save the current URL even if media from that URL has already been cached. [default: false]**Don't set Globally**
23
24
24
25
### Attaching to an Element
25
26
`$('img#AnElement').cacheImages();`
@@ -55,7 +56,9 @@ If you need to use an image in your inline css, or in another context where you
55
56
56
57
Helpful to clean up stored images from the cache without dropping everything stored. You can optionally set a *url*, and/or *storagePrefix* in the function to only drop specific image, or set of images.
57
58
58
-
59
+
## indexDB and callbacks
60
+
One of the major differences between localstorage and indexDB is that the queries to the database happen out of the functional flow of your script. This means you must use callbacks to excecute scripts with the outcome, or after the conclusion of the previous script. Not using callbacks can result in weird behavior.
61
+
59
62
# Credits and Thanks
60
63
* Based Heavily off of @doomhz plugin [jQueryImageCache](https://github.com/doomhz/jQuery-Image-Cache)
61
64
* Utilizing base64 encoding from @mathias[Encoding XHR image data](http://jsperf.com/encoding-xhr-image-data/33)
0 commit comments