Giter Site home page Giter Site logo

Comments (6)

paulprins avatar paulprins commented on September 25, 2024

@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.

darrellpruitt avatar darrellpruitt commented on September 25, 2024

Thank you! Very much appreciated!

Darrell

from jquery-cache-images.

darrellpruitt avatar darrellpruitt commented on September 25, 2024

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.

paulprins avatar paulprins commented on September 25, 2024

Good call @darrellpruitt - I also made that fix, but instead of no params it now reads

callbackFunction.call( url );

from jquery-cache-images.

darrellpruitt avatar darrellpruitt commented on September 25, 2024

Perfect! Thanks!

Darrell

from jquery-cache-images.

paulprins avatar paulprins commented on September 25, 2024

Awesome, glad that it's working for ya!

from jquery-cache-images.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.