Entries tagged with “JavaScript”
Optimizing this blog for easy reading on an iPhone turned out to involve some hacking. It did not take much time to implement, but within the constraints of static HTML pages, I had to combine a couple of tricks to make, firstly, the pages more readable on the iPhone screen, and secondly, to make the pages load faster by cutting down the number of resources downloaded over the poor AT&T Edge network. The solution required using a combination of the user-agent string and CSS3.
JSON vs XML wars are still going on, and they are becoming more amusing, I must say. The latest is from Sean McGrath arguing about the significance of mixed content in XML.
The discussion at Dare Obasanjo's blog, and the references to some other recent posts motivate me to look at some of the broader arguments being made. It is clear that processing JSON data using JavaScript is trivial, and that is what makes JSON a popular alternative over XML currently. All other advantages and disadvantages over XML are incidental. If we take out JavaScript from the picture, JSON is not a clear winner. Both JSON and XML take some effort to parse and process outside JavaScript.
Carlos Perez wrote a very interesting piece asking What did JavaScript have that Java did not? The question initially seemed obvious, but he makes some good points about JavaScript and dynamically typed languages.
If you one of those developers that don't care much about JavaScript, CSS and the like, and do write code related to the web, you are going to disagree with what I am about to say in this post.
What is the right response format for XMLHttpRequest in Ajax applications? The answer is simple for most markup-oriented applications - use HTML. For data-oriented applications the choice is between XML and JSON. Until recently I did not pay much attention to the question of whether to use XML or JSON. I just presumed that the use case at hand will dictate the format. I had a chance to test this presumption recently. In this post, I would like to describe the criteria I used for comparing between XML and JSON, and my analysis.