I've been working off and on on an extension to Movable Type that allows you to do surveys, and it's proved to be a good testing sandbox for me to try out new ideas for hacking on Movable Type. One of the things that shows a lot of promise is getting an extension to build JSON for enabling AJAX throughout an extension. I admit that there is some overhead in using a descendant of MT::App to generate JSON from a template file, but it should be less intense on the server than having it generate the whole page or widget. Every browser out there that is at least a few years old fully supports JSON and DOM scripting, so there is no reason to make the server generate the whole page when most of the generation can be done on the client side by building the page from descriptions in the JSON sent back by the server. To put this into perspective, all I would have to send back from the server to communicate the results of a simple survey, would be a JSON block that looks like:
That could make for less overhead in rebuilding a template data intended to feed AJAX data to other parts of the application.
{
questions: ["What type of blog is your favorite?", "Where do you host your blog?", "Do you plan to switch software?"],
types: ["MC", "MC", "TF"],
answers: [["Tech","Politics","Religion","Entertainment"],
["Blogger","Typepad","WordPress.com","Self-hosted"], ["Yes", "No"]],
responses: [[20,20,20,40], [50, 10, 10, 30], [40, 60]]
}
That could make for less overhead in rebuilding a template data intended to feed AJAX data to other parts of the application.
Leave a comment