XMLHttpRequest object once its operation is completed, but before it has been passed to the returned promise chain, so the promise may still end up in an rejected state if processing throws an exception.</p>
<hr>
<h3 id=why-json-instead-of-html><a href=#why-json-instead-of-html>Why JSON instead of HTML</a></h3>
<p>Many server-side frameworks provide a view engine that interpolates database data into a template before serving HTML (on page load or via AJAX) and then employ jQuery to handle user interactions.