Permalink
Browse files

Fixed a bug with IE6

  • Loading branch information...
1 parent f45f5fd commit b8a1359f0abb33c76357240fbf510537e7a00969 @andris9 andris9 committed Apr 9, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 jstorage.js
View
@@ -51,7 +51,7 @@
*/
(function($){
- if(!$ || !($.toJSON || Object.toJSON || JSON))
+ if(!$ || !($.toJSON || Object.toJSON || window.JSON))
throw new Error("jQuery, MooTools or Prototype needs to be loaded before jStorage!");
$.jStorage = {
@@ -68,10 +68,10 @@
_storage_elm: null,
/* function to encode objects to JSON strings */
- json_encode: $.toJSON || Object.toJSON || JSON.encode,
+ json_encode: $.toJSON || Object.toJSON || (window.JSON && JSON.encode),
/* function to decode objects from JSON strings */
- json_decode: $.evalJSON || (JSON && JSON.decode) || function(str){
+ json_decode: $.evalJSON || (window.JSON && JSON.decode) || function(str){
return String(str).evalJSON();
},

0 comments on commit b8a1359

Please sign in to comment.