OfflineSaveQueue, an HTML5 Local Storage Solution

I created a new JavaScript library called OfflineSaveQueue.  The purpose of this library is to temporarily save JSON objects in HTML5 Local Storage in the event that an internet connection is not available.

The creation of this library arose out of my need to save data to from a PhoneGap application.  The app was not guaranteed to have internet connectivity so I needed a way to put the data in a temporary queue where it could be kept until I got a success callback from Parse.

OfflineSaveQueue is not being maintained anymore and I don’t recommend using it.  However, if interested you can still take a peek at the GitHub repository.

Usage of OfflineSaveQueue is simple:

Instantiate an OfflineSaveQueue object:

var offlineSaveQueue = new OfflineSaveQueue();

Set the callback function which is executed when the queue is processed:

offlineSaveQueue.setCallback(function(objectInstance, objectName){

//Do stuff here...


Start periodic queue processing:


Stop periodic queue processing:


Save an item into the queue

offlineSaveQueue.saveObject({"foo": "bar"}, "DummyObject");

Manually process the queue


Get the number of items in the queue:


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s