javascript - 显示加载图像并在页面链接上加载新页面

标签 javascript jquery post get load

首先我想说我的英语不太好,我是荷兰人!

无论如何,我最近在一个网站上,当我想在该网站上打开一个新页面时,有一个加载图标,而不是该网站的内容,然后滑落新内容被撤回并重写了 URL。 我想知道我该怎么做?该网站现已关闭!在那里我注意到了一些事情。

    pageLoad: function (after){
    jQuery(window).load(function(){
        $thunderbolt.backdropContainerStatics();
        if(notifications.userLoggedIn == '') $thunderbolt.checkForWidthWhiteTop();
        $thunderbolt.openWhiteTopContainer();
        jQuery('body').append('<input type="hidden" class="pageLoadingStatics" value="loaded">');
        jQuery('.firstLoadScreen .loaderBulletcontainer').fadeOut(function(){
            jQuery('.firstLoadScreen').fadeOut('slow', function(){
                jQuery('.onloadscreenafter').fadeIn('slow', function(){
                    if($thunderbolt.welcome == true){
                        floatLoadPage('welcome');
                    }
                    notifications.start();
                });     
                jQuery('body').show(after);         
                jQuery(window).resize(function(){ 
                    if(notifications.userLoggedIn == '') $thunderbolt.checkForWidthWhiteTop(); 
                });
            });
        });
    });
},

其他代码

    pageLoader: function(type){
    if(type == 'show'){
        jQuery('.individualPageloader').show();
        jQuery('.individualPageloader .insidePageLoader').animate({
            marginTop: '0px'
        }, 500);
    }else{
        jQuery('.individualPageloader .insidePageLoader').animate({
            marginTop: '-80px'
        }, 500, function(){
            jQuery('.individualPageloader').hide();
        });
    }
},

getPage: function(value){
    getPage(value);
},

getPagePost: function(value, post, action){
    getPagePost(value, post, action);
},

replacePageInfo: function(sitename, data, page){
    jQuery('html title').html(sitename + ' :: ' + data);
    window.history.pushState(sitename, sitename + ' ~ ' + data, $thunderbolt.url + '/' + page);
},

功能

function getPage(value){
$thunderbolt.pageLoader('show');

jQuery.post($thunderbolt.url + "/page/" + value, function(page){
    jQuery('.loadIntoContainer .loadIntoContainerInside').fadeOut(function(){
        jQuery(this).html(page).fadeIn(function(){
            $thunderbolt.pageLoader('hide');
        });
        Cufon.replace("ubuntu");
        $thunderbolt.disableImageDrag();
    });
});

}

函数 getPagePost(值、帖子、操作){ $thunderbolt.pageLoader('show');

jQuery.ajax({
    type: "POST",
    url: $thunderbolt.url + "/page/" + value,
    data: "" + post + "",
    success: function(page){
        jQuery('.loadIntoContainer .loadIntoContainerInside').fadeOut(function(){
            jQuery(this).html(page).fadeIn(function(){
                $thunderbolt.pageLoader('hide');
            });
            Cufon.replace("ubuntu");
            $thunderbolt.disableImageDrag();
        });
    }
});

}

其他功能

function floatLoadPage(value, after){
jQuery('.floatLoadPage').html('<div class="quickProfileLoader" style="width: 40px; height: 40px; margin: auto; margin-top: 25%;"><img style="width: 40px; height: 40px; margin-top: -20px;" src="assets/image/general/loader/loader_white.gif"></div>').fadeIn('slow');
$thunderbolt.floatBackdropClick('.floatLoadPage');

jQuery.get("../../application/pages/float/float-" + value + ".php", function(data){
    if(after == null){
        jQuery('.floatLoadPage').html(data);
    }else{
        jQuery('.floatLoadPage').html(data).fadeIn(after);
    }
    $thunderbolt.center(jQuery('.floatLoadPage .floatContainer'), 'absolute', true, '', '0', '0');
    Cufon.replace("ubuntu");
    $thunderbolt.disableImageDrag();
});

}

函数 floatLoadPagePost(值、帖子、操作){ jQuery('.floatLoadPage').html('').fadeIn(); $thunderbolt.floatBackdropClick('.floatLoadPage');

jQuery.ajax({
    type: "POST",
    url: "../../application/pages/float/float-" + value + ".php",
    data: "" + post + "",
    success: function(data){
        jQuery('.floatLoadPage').html(data);
        $thunderbolt.center(jQuery('.floatLoadPage .floatContainer'), 'absolute', true, '', '0', '0');
        Cufon.replace("ubuntu");
        $thunderbolt.disableImageDrag();
    }
});

}

这是在外部。 Js文件

我在标签中找到了这个

<script>

                                $thunderbolt.getPage('me');

所有页面均使用以下代码加载

 <li onclick="$thunderbolt.getPage(&#39;radio&#39;);">

如何使这段代码正常工作? 谢谢!

最佳答案

哦,抱歉,$thunderbolt 是网站名称!

关于javascript - 显示加载图像并在页面链接上加载新页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20195077/

相关文章:

http - http中post数据的最大大小

javascript - 如何在用户打开新选项卡或网站处于非事件状态时重新启动 css 动画

javascript - Angular 不解析 IE9 和 10 中 style 属性中的模板 {{value}}

javascript - 级联 promise

javascript - 数据表 orderable=false 直接在表上

javascript - 如何将 $(document).ready(function() 添加到 joomla

javascript - 如何滚动到父 iframe 的顶部按下 iframe 内的按钮?

ios - 当我扭曲服务时调用 alamofire 异步?

vue.js - 如何在Go Web服务器和Vue.js前端之间交换数据? http发布:404

javascript - 带有 url 的页面加载上的事件选项卡