From: Dennis Schafroth Date: Fri, 25 Jun 2010 08:24:22 +0000 (+0200) Subject: Remove simulation of JSON X-Git-Tag: v1.4.4~55 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=77659a8b193d49d6353e508a647df20cdfd0a7e4;p=pazpar2-moved-to-github.git Remove simulation of JSON --- diff --git a/www/iphone/iphone.js b/www/iphone/iphone.js index 65c7d1e..9c9fbe0 100644 --- a/www/iphone/iphone.js +++ b/www/iphone/iphone.js @@ -1,6 +1,5 @@ var count = 0; var termlist = {}; -var JSON = JSON || {}; var inApp = false; var callback = {}; @@ -39,29 +38,6 @@ callback.send = function() document.getElementById("log").innerHTML = message; } -// implement JSON.stringify serialization -JSON.stringify = JSON.stringify || function(obj) { - var t = typeof (obj); - if (t != "object" || obj === null) { - // simple data type - if (t == "string") - obj = '"' + obj + '"'; - return String(obj); - } else { - // recurse array or object - var n, v, json = [], arr = (obj && obj.constructor == Array); - for (n in obj) { - v = obj[n]; - t = typeof (v); - if (t == "string") - v = '"' + v + '"'; - else if (t == "object" && v !== null) - v = JSON.stringify(v); - json.push((arr ? "" : '"' + n + '":') + String(v)); - } - return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}"); - } -}; function search(message) { document.search.query.value = message;