$("#btnLoad").click(function(){
// Put an animated GIF image insight of content
$("#content").empty().html('<img src="loading.gif" />');
// Make AJAX call
$("#content").load("http://example.com");
});
<button id="btnLoad">Load Content</button>
<div id="content">
Please click "Load Content" button to load content.
</div> |