This is a Asp.net 3.5 Web Application
I have a variety of data collections, like "Featured Blogs", "Event List", "Top Events" etc. About 5-10 in total.
I need this data to display on a variety of templates (same domain - no cross domain issues)
I do not want to force the designers to learn C#, instead I'd like them to just use jQuery to get the data and display it on a page.
What's the best implementation to support this?
- Use ASMX Web Service to return serialized object collections of data
- Create a .ashx handler for all 10 collections (seems a bit inefficient)
- Create a asp开发者_如何学Go.net web form that accepts a query string (for the collection type) then returns a pure XML doc
Thanks for your help!
Yes, while I love xml to and completely believe in the need for a uniform manner of transferring data between applications that aren't inherently woven together...json is the easiest way to transfer data to jquery/javascript on the client side. The find() function makes xml parsing pretty darn easy to use but jquery has built in $.getJSON and $.parseJSON methods. Alot of jquery plugins/widgets also use json by default ie DataTables ( all though you can change this too if you like ). Overall if you are trying to simplify things for them, JSON is probably your best bet.
精彩评论