/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
const div_content="#containerMain"; const img_loading="<div id='loading'><img src='images/loading.gif' /></div>"; function LoadContent(namecontent){ $.ajax({ url: base_url_include+namecontent, context: document.body, dataType: "html", cache: true, beforeSend: function(){ $(div_content).html(img_loading); }, success: function(html){ $(div_content).html(html); } }); }