jquery在加载页面后加载div [英] jquery load div after page load

查看:90
本文介绍了jquery在加载页面后加载div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我正在寻找的是加载页面,然后是一个有大量数据的div。所以,我想首先加载主页面,然后使用jQuery函数加载body div内容,延迟一些。



执行此操作的简单方法是什么?

  < div id =container> 
< div id =header>导航< / div>
< div id =bodyclass =body> Body< / div>
< div id =footer> footer< / div>
< / div>


解决方案

  $(文档).ready(function(){

$ .get('ajax / page.php',function(data){
$('#body')。html(data) ;
});

});


Actually what I am looking for loading is loading the page first and then a div with lots of data. So, I want to load the main page first and then body div content using jQuery function with some delay.

What is the simple way of implementing this..?

 <div id="container">
      <div id="header">navigation</div>
      <div id="body" class="body">Body</div>
      <div id="footer">footer</div>
 </div>

解决方案

$(document).ready(function(){

  $.get('ajax/page.php', function(data) {
    $('#body').html(data);
  });

});

这篇关于jquery在加载页面后加载div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆