zoukankan      html  css  js  c++  java
  • AJAX遮罩实例

    function transferip()
    {
        var site_list=$("textarea[name='Oldsite']").val();
        var ip_list=$("textarea[name='Oldip']").val();
        var ip_new=$("input[name='Newip']").val();
        if(ip_list==""||ip_new=="")
        {
            alert('IT CANNOT BE EMPTY!');
            return false;
        }
        ajaxStar("LOADING...");
        $.ajax(
        {
            type:"post",
            url:"transip.mazey",
            data:{"search":"check_ip","ip_list":escape(ip_list),"ip_new":ip_new,"site_list":escape(site_list)},
            error:function(){
                ajaxClose();
                alert("SYSTEM ERROR!");
            },
            success:function(msg)
            {
                ajaxClose();
                var msgArr=msg.split("-|-")
                if(msgArr[0]=="413")
                {
                    alert(msgArr[1]);
                }
                else
                {
                    alert(msgArr[1]);
                }
    
            }
        }
        )
    }
    
    /**div加载ajax效果***/
    function ajaxStar(str,e){//str提示信息  e:iframe框访
        var html="";
        html+="<div id='ajaxLoadDiv'></div>";
        html+="<div class='ajaxLoadIcon'>";
        html+= "<span class='ajaxIcon'></span>";
        if(str)
            html+="<span class='ajaxInfo'>"+str+"</span>";
        html+="</div>";
        $("body").append(html);    
        var divH=$(document).height();//-$("#admin_topbj").height();
        $("#ajaxLoadDiv").css({"height":divH,"top":0,"opacity":0.5});
        var iconTop=$(window).height()/2;
        iconTop=iconTop+$(document).scrollTop();
        $(".ajaxLoadIcon").css({"top":iconTop+"px"});
    }
    
    /****关闭ajax遮罩*****/
    function ajaxClose(){    
        $("#ajaxLoadDiv").remove();
        $(".ajaxLoadIcon").remove();    
    }
    
    function look_seven(){
        window.location.href="/Setinmanager/winhost/migratejob/record.asp";
    }

    图片:overlay.png

    ajax遮罩

    图片:ajaxLoad.gif

    ajax遮罩

    不知不问

  • 相关阅读:
    CSS3弹性盒布局方式
    Vue知识点(面试常见点)
    h5新增加的存储方法
    前端常用插件
    Git 及 GitHub 使用
    Express 框架
    angular.js 教程 -- 实例讲解
    Windows右键添加VSCode启动
    Windows平台SSH登录Linux并使用图形化界面
    10_Linux yum命令
  • 原文地址:https://www.cnblogs.com/mazey/p/6129832.html
Copyright © 2011-2022 走看看