Nested ajax calls using $.when
http://stackoverflow.com/questions/23622311/nested-ajax-calls-using-done
HTML
<script src="https://jquery-json.googlecode.com/files/jquery.json-2.2.js"></script>
<input type="button" id="btn" value = "teste"/>
JavaScript
$("#btn").click( function(){
});