Last modified: 2011-04-23 20:37:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30099, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28099 - Add toJSON javascript module in core
Add toJSON javascript module in core
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.18.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-17 22:44 UTC by Krinkle
Modified: 2011-04-23 20:37 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2011-03-17 22:44:32 UTC
There are several implementations out there.

The "most popular" one (recommended by John Resig from jQuery and promoted on http://www.json.org/ ) is D. Crockgord's implementation: https://github.com/douglascrockford/JSON-js
The main script is at [1].

Thanks to janpaul123 for the idea to add this to core. This will make it very easy to send a nested object of information to core and also maintain types (ie. boolean and numbers). Both of which are hard when posting them directly as parameters in the request.


It should be defined as extending the jQuery root object (not a prototype) as $.toJSON

--
Krinkle


[1] https://github.com/douglascrockford/JSON-js/blob/master/json2.js
Comment 1 Krinkle 2011-04-23 20:37:53 UTC
Done by Trevor in r86657.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links