<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?

    1 answer 1

    Even the ajax form is not needed here.

    jquery load

     <div id='content'> <a href="#" onclick='$("#content").load("ajax.html #12346");'>Load</a> </div> 

    ajax.html

     <div id="12345">qeqqe</div> <div id="12346">qwert</div>