mirror of
https://github.com/jsbin/jsbin.git
synced 2026-02-01 16:46:05 +00:00
Fixed Opera 10 error. Since it was the only browser that didn't have native json parsing, it was deferring to the json2.js lib and trying to pass null to parse, which would bork. f:2
This commit is contained in:
parent
db0f52e991
commit
4b22812d36
@ -6,7 +6,7 @@ var push = Array.prototype.push;
|
||||
var Libraries = function () {
|
||||
this.init();
|
||||
|
||||
this.userSpecified = JSON.parse(localStorage.getItem('libraries')) || [];
|
||||
this.userSpecified = localStorage.getItem('libraries') || [];
|
||||
|
||||
// read from storage
|
||||
for (i = 0; i < this.userSpecified.length; i++) {
|
||||
@ -91,7 +91,7 @@ Libraries.prototype.add = function (lib) {
|
||||
// save to localStorage
|
||||
this.userSpecified.push(lib);
|
||||
try {
|
||||
localStorage.setItem('libraries', JSON.stringify(this.userSpecified));
|
||||
localStorage.setItem('libraries', this.userSpecified);
|
||||
} catch (e) {} // just in case of DOM_22 error, makes me so sad to use this :(
|
||||
push.call(this, lib);
|
||||
$('#library').trigger('init');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user