<div id="preload" class="preload"></div> <div id="content"> <a href="#" id="/ajax.html" onclick="link();">Test</a> </div>
function link() { $("#preload").html('Загружаем...'); var url = $("a").attr("id"); $.ajax({ url: url, cache: false, success: function(html) { $("#content").html(html); $("div.preload").remove(); } }); }
Clicking loads content
ajax.html
<div id="12345">...</div>
Accordingly, the entire file is loaded, and you only need to download content with the identifier 12345. How to do this?