2 ms·
Niche? I guess you don't use json. jquery already autodetects xml, why not json too? It's not even hard - it's right in the content type. I know how to detect
by ars 18y ago
Niche? I guess you don't use json. jquery already autodetects xml, why not json too? It's not even hard - it's right in the content type.
I know how to detect errors, that was hardly my point. I was suggesting an improvement, not tech support.
- mmj 18y agoYou don't have to eval xml.
- natrius 18y agoYou don't have to eval JSON. http://www.json.org/js.html http://www.json.org/js.html
- mmj 18y agohttp://www.json.org/json2.js http://www.json.org/json2.js // In the third stage we use the eval function to compile the text into a // JavaScript structure. The '{' operator is subject to a syntactic ambiguity // in JavaScript: it can begin a block or an object literal. We wrap the text // in parens to eliminate the ambiguity.
- ars 18y agohttp://www.json.org/json_parse.js http://www.json.org/json_parse.js // This is a function that can parse a JSON text, producing a JavaScript // data structure. It is a simple, recursive descent parser. It does not use // eval or regular expressions, so it can be used as a model for implementing // a JSON parser in other languages.
- mmj 18y agoYes, but even better would be to use jQuery's excellent JSONP method.