Posted By

jose_506 on 09/16/11


Tagged

ajax php loading


Versions (?)

function load by ajax


 / Published in: PHP
 

  1. const div_content="#containerMain";
  2. const img_loading="<div id='loading'><img src='images/loading.gif' /></div>";
  3.  
  4. function LoadContent(namecontent){
  5. $.ajax({
  6. url: base_url_include+namecontent,
  7. context: document.body,
  8. dataType: "html",
  9. cache: true,
  10. beforeSend: function(){
  11. $(div_content).html(img_loading);
  12. },
  13. success: function(html){
  14. $(div_content).html(html);
  15. }
  16. });
  17. }

Report this snippet  

You need to login to post a comment.