Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best, light-weight JSON/ajax script?

Tags:

I am creating a joomla plugin and want to load an array of images after the page has loaded. To do that, I'm currently using mootools.js to call myserver URL, obtain the JSON response and parse the response into javascript variables that represent each image url. It works great, but mootools.js is appropriately named since it is a real heffer in the size department.

Is there a lightweight script out there that will make the ajax call and parse the JSON object? The smaller the better.

like image 696
user38339 Avatar asked Nov 17 '08 19:11

user38339


2 Answers

I just found a JSON parser, json2.js, at json.org that minifies down to about 3k. You basically do a standard HTTPRequest via AJAX and then pass the response text to the JSON parser to create the JSON object.

Thanks for all the answers and I did track them all down. I couldn't get any of them small enough to compete with this approach, though.

like image 71
user38339 Avatar answered Nov 15 '22 05:11

user38339


There are quite a few javascript frameworks out there in addition to Mootools that can accomplish what you're looking for. I recommend taking a look at Jquery or Prototype. They're very similar to Mootools and the mini-fied versions may provide the lightweight solution you're looking for:

http://jquery.com/

http://www.prototypejs.org/

like image 35
Anne Porosoff Avatar answered Nov 15 '22 05:11

Anne Porosoff