Javascript 加载gif直到页面完全加载

Javascript 加载gif直到页面完全加载,javascript,php,jquery,Javascript,Php,Jquery,我正在尝试显示正在加载的GIF,并一直显示到页面完全加载为止 以下是我的jQuery/Javascript代码: $(document).ready(function(){ $('#myTab a').on('load', function (e) { e.preventDefault(); $(this).tab('show'); },onLoadSomeFunction()); } onLoadSomeFunction()引导我的页面获取一些值

我正在尝试显示正在加载的GIF,并一直显示到页面完全加载为止

以下是我的jQuery/Javascript代码:

$(document).ready(function(){
   $('#myTab a').on('load', function (e) {
        e.preventDefault();
        $(this).tab('show');
    },onLoadSomeFunction());
}
onLoadSomeFunction()
引导我的页面获取一些值并加载到其中

如何在所有页面加载过程结束之前显示加载gif?

    please try this:- 
$(document).ready(function(){
       $('#myTab a').on('load', function (e) {
            e.preventDefault();
      $(this).tab('show'); or $('#load_img/message').show();// div having loading image/message and initially property hidden

        },onLoadSomeFunction()); or success : function(html){
               //your functionality after success
                 $('#load_img/message').hide(); // hide the loading image/message
            }
    }
//尝试使用以下代码
//Jquery
$(文档).ready(函数(){
$('#myTab a')。在('load',函数(e)上{
e、 预防默认值();
$(this.tab('show');
},onLoadSomeFunction());
}
$(窗口)。加载(函数()
{
$('.gif_image').hide();
});