I am new to web programming and just started learning XML and AJAX. I am creating a social gaming website for my college project. I am confused at the point of using XML for AJAX in HTML5. As XHTML is replaced by HTML5 so is it ok to use XML or i should choose JSON (i know nothing about JSON but it is what I found in answers on web to the question related to choice between JSON and XML). My preference is XML because it is in my syllabus but I want to make sure that XML and HTML5 will not conflict.
3
You can encode the data sent to the server in any format you want and not interfere with the web page’s standards.
The idiomatic thing to do is to just use JSON these days, but that is up to you.
It’s also important to note that if you use a non HTML5 tag, the police aren’t going to show up at your door and, unless your professor validates your site using a tool, he probably won’t notice and it will render just fine.
Certain things in your page like <br>
being more HTML5 compatible than <br/>
will break XML compatibility, if that’s what your asking. But the standard still leaves a clause allowing full XML compatibility in order to allow any page to comply with XML, AFAIK. Though, from the discussion in that thread, this is explicitly for backwards compatibility purposes with the older HTML standards.
3