The sample, which focuses on the Spring MVC code, is fronted by a JSP that uses JQuery together with a JSON JQuery javascript called ‘json.min.js’, which is somewhat anonymous.
It turns out that this code was written by Douglas Crockford and can be download from https://github.com/douglascrockford/JSON-js and is referenced from the JSON Website. This isn’t, however, the original code, it’s been hacked and had a couple of methods added:
$.fn.serializeObject = function() { etc
$.postJSON = function(url, data, callback) { etc
It could be argued that in a ‘real’ application, it’s not a good idea to modify other people’s libraries as this prevents you from taking and using their updates, but hey, this is only sample code.
No comments:
Post a comment