Giter Site home page Giter Site logo

jquery-offline's Issues

Infinite loop in after NS_ERROR_DOM_QUOTA_REACHED

Scenario.

  • localStorage already has other data in it.
  • Plug-in tries to store json, but it is too big.
  • cleanUpLocalStorage has a go at cleaning up but finds nothing to do (the data already in localStorage has nothing to do with the plug-in)
  • Loops around and tries again. Still too big (obviously). Loops around and tries again......and so on.

Result: Infinite loop.

no callback incase of a 304 notmodified status

at the point where the jquery ajax call is made a 304 will return without calling the fn callback function [>getJSON]
this inturn will never reach the caller [>getData] at "if ( status == 'notmodified' ) {.."

I've added the following lines as a fix:
[line 71 - add] if(text=='notmodified'){ fn(undefined, text); }/ /=>Added by Oded
[line 152 - add] fn(json, status, data); //=>Added by Oded

Handling empty params

line 181 tests "if(text)" and incase no params are passed the text resolves to "null" as string, this inturn will enter the condition and an exception will be thrown.

I've replaced this line with:
if(text && text != "null")
This puts me back on track

Oded

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.