JSON is Java Script Object Notation. It's a way of encoding structured data as text strings which originated (as in name implies) in javascript, but is now widely used as a data exchange format, with support in nearly every programming language. https://www.w3schools.com/js/js_json.asp https://www.w3schools.com/js/js_json.asp
But, in the context you're using it, it's a library of JSON parsing and encoding functions built into the javascript implementation on most browsers. https://www.w3schools.com/Js/js_json_parse.asp https://www.w3schools.com/Js/js_json_parse.asp
If you've opened your browser's console, you should be able to type JSON at it and get back something like:
JSON JSON {Symbol(Symbol.toStringTag): "JSON", parse: ƒ, stringify: ƒ}parse: ƒ parse()arguments: (...)caller: (...)length: 2name: "parse"__proto__: ƒ ()[[Scopes]]: Scopes[0]stringify: ƒ stringify()Symbol(Symbol.toStringTag): "JSON"__proto__: Object
If you get something like "JSON is not defined", you're probably running an ancient browser.
On Oct 30, 2020, at 11:05 AM, Strainu strainu10@gmail.com wrote:
Hi,
I'm looking at solving the following console warning on ro.wp: "JQMIGRATE: jQuery.parseJSON is deprecated; use JSON.parse" which appears due to outdated Twinkle code. Just making the replacement does not work, since JSON is not defined. As a matter of fact, I cannot find it anywhere else in the code loading on a normal Romanian Wikipedia page.
Alas, the generic name of that object makes searching on mw.org or Google rather useless. I can see some similar changes in Phabricator, but they seem to work.
So, what is JSON and how can I use it in my code?
Thanks, Strainu
P.S. Please don't suggest updating Twinkle...
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l