Can anyone give me a good reason why I would want to use XML as a response from an ajax request other than organizational purposes and ease of readability? I’m trying to be as secure as possible, and I’m not sure if using XML is more secure or simply better practice? Most sources provide reasons to use XML that don’t interest my security concerns.
Share
I think this depends on where you are returning to. Usually if returning to javascript (which i am assuming here) is is beneficial to re turn using JSON format. JSON is simple and lightweight. There are methods in .NET and also jQuery that can parse and serilize/decerlize this.
this will parse a JSON string to a JQuery object
this will parse an object into a jquery string you can send up to an ajax call
this snippet illustrates deserlizing a json string into a generic list type of a predefined class.