mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
No more parseJSON error - fixes #244
This commit is contained in:
parent
b06d68a43f
commit
5fef8cf031
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user