zoukankan      html  css  js  c++  java
  • js重写系统的弹框

     //调用系统的弹框,不显示地址

    window.alert = function(name){
        var iframe = document.createElement("IFRAME");
        iframe.style.display="none";
        iframe.setAttribute("src", 'data:text/plain,');
        document.documentElement.appendChild(iframe);
        window.frames[0].window.alert(name);
        iframe.parentNode.removeChild(iframe);
    };

    window.confirm = function (message) {
        var iframe = document.createElement("IFRAME");
        iframe.style.display = "none";
        iframe.setAttribute("src", 'data:text/plain,');
        document.documentElement.appendChild(iframe);
        var alertFrame = window.frames[0];
        var result = alertFrame.window.confirm(message);
        iframe.parentNode.removeChild(iframe);
        return result;
    };
  • 相关阅读:
    虚拟机Centos安装docker小记
    Python selenium入门
    selenium Error
    DveOps路线指南
    DevOps
    Go语言常量和变量
    安装Go语言及环境的搭建
    Win10 搭建IIS服务
    linux 上搭建sftp服务
    linux小命令
  • 原文地址:https://www.cnblogs.com/ch-zaizai/p/7449295.html
Copyright © 2011-2022 走看看