I found myself in a situation recently where I wanted to have access to variables that would have been posted, in a the same structure as if the form had been posted and returned the JSON, using this jQuery plugin and Douglas Crockford’s JSON library, I think I’ve done it!
You can download the script here and there’s a demo here.