No more parseJSON error - fixes #244

This commit is contained in:
Mottie 2013-02-24 00:22:27 -06:00
parent b06d68a43f
commit 5fef8cf031

View File

@ -74,11 +74,11 @@ $.tablesorter.storage = function(table, key, val){
// *** get val ***
if ($.parseJSON){
if (ls){
v = $.parseJSON(localStorage[key] || '') || {};
v = $.parseJSON(localStorage[key] || '{}');
} else {
k = document.cookie.split(/[;\s|=]/); // cookie
d = $.inArray(key, k) + 1; // add one to get from the key to the value
v = (d !== 0) ? $.parseJSON(k[d] || '') || {} : {};
v = (d !== 0) ? $.parseJSON(k[d] || '{}') : {};
}
}
// allow val to be an empty string to