mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
updated localstorage check
This commit is contained in:
parent
61c961ef5b
commit
4494da5357
@ -70,7 +70,14 @@ ts.storage = function(table, key, val){
|
||||
var d, k, ls = false, v = {},
|
||||
id = table.id || $('.tablesorter').index( $(table) ),
|
||||
url = window.location.pathname;
|
||||
try { ls = !!(localStorage.getItem); } catch(e) {}
|
||||
// https://gist.github.com/paulirish/5558557
|
||||
if ("localStorage" in window) {
|
||||
try {
|
||||
window.localStorage.setItem('_tmptest', 'temp');
|
||||
ls = true;
|
||||
window.localStorage.removeItem('_tmptest');
|
||||
} catch(e) {}
|
||||
}
|
||||
// *** get val ***
|
||||
if ($.parseJSON){
|
||||
if (ls){
|
||||
|
Loading…
Reference in New Issue
Block a user