- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
function fixMootoolsJSON(thing) {
var i, member, pattern = /^"\[.*\]"$/, copy;
if (thing instanceof Array) {
for (i = 0; i < thing.length; i++) {
member = thing[i];
if (typeof member == "string" && pattern.test(member)) {
thing[i] = fixMootoolsJSON(JSON.decode(member));
}
}
} else if (typeof thing == "object") {
copy = { };
for (i in thing) {
if (thing.hasOwnProperty(i)) {
copy[i] = fixMootoolsJSON(JSON.decode(thing[i]));
}
}
for (i in copy) {
if (copy.hasOwnProperty(i)) {
thing[i] = copy[i];
}
}
}
return thing;
}
bot-minurast 25.02.2013 00:44 # −1