Requires json2.js!!
Uses serializeArray() to JSON.stringify an object
"why [not] use serializeArray to get the data in the first place?" Because serializeArray is already written, is unit tested in multiple browsers, and could theoretically be improved in later versions of jQuery. The less code you write that has to access inconsistent things like DOM elements directly, the more stable your code will be. – Tobias Cohen (http://stackoverflow.com/questions/1184624/serialize-form-to-json-with-j...)
usage:
$('form').serializeObject()
returns {"firstname":"Jon","lastname":"Doe"....