Comments (6)
@darrellpruitt yea you weren't doing anything wrong. the issue is that the drop function didn't have a callback, and thats why you were having issues. IndexDB is not a functional call (it breaks out of the line by line flow you're expecting with your javascript). I just updated the script adn you should be able to do this now one of two ways.
Using the callback for the drop script:
$.fn.cacheImages.drop(v_charturlactuals, function(){
$('.summarychartimgactuals'+obj.SUMMARY_TESTNUM_ID).cacheImages( {storagePrefix: v_storagePrefix, url: v_charturlactuals} );
}, v_storagePrefix);
Or, even more simply with the forceSave option just added.
$('.summarychartimgactuals'+obj.SUMMARY_TESTNUM_ID).cacheImages( {storagePrefix: v_storagePrefix, url: v_charturlactuals, forceSave: true });
Be careful with the forceSave though. If you always use it the plugin is pretty pointless as it will always fetch a new image. In an ideal world where you control the media you're fetching from the remote server you shouldn't reuse the same filenames (keeps browsers/third-party from caching) but either of these options should work for ya.
from jquery-cache-images.
Thank you! Very much appreciated!
Darrell
from jquery-cache-images.
I had to make one change to your code. I was getting a javascript error “thisElem is not defined” for the line:
callbackFunction.call(thisElem, key, encodedString );
Since I didn’t need those variables in my callback I changed it to the following and it worked great:
callbackFunction.call( );
Darrell
from jquery-cache-images.
Good call @darrellpruitt - I also made that fix, but instead of no params it now reads
callbackFunction.call( url );
from jquery-cache-images.
Perfect! Thanks!
Darrell
from jquery-cache-images.
Awesome, glad that it's working for ya!
from jquery-cache-images.
Related Issues (12)
- Allow for binding to specific element
- Ensure all URLs are cached as full URIs HOT 1
- Implement some basic base64 encode checks HOT 1
- Abstract the actual caching into a javascript function HOT 2
- Create function to place images HOT 1
- Allow for binding to specific parent
- Add Callbacks
- Persistant binding to elements
- Abstract storage to functions for overriding to different methods
- Create a version to use indexedDB
- Adapt drop to target a specific cached url
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-cache-images.