问题: 系统默认的alert弹框的title会默认显示网页域名

解决办法:

(修改弹框样式)

(function() {
window.alert = function(name) {
$(".tip").css("display", "block")
$(".tip .content").html(name)
}
})()

调用:alert(name)

在页面中添加弹框元素,自定义其样式,默认隐藏

:alert()方法重写,不能传多余参数

(仅去掉网址)

(function(){
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);
}
})();
alert('试一试');

最新文章

  1. shell 计算
  2. Swift语言快速入门
  3. MUI(2)
  4. FIR数据广播结构-提高时钟速率
  5. POJ 2013
  6. 【Web探索之旅】第三部分第一课:服务器
  7. source is null for getProperty(null, "cpmodel")异常结局
  8. Java中实例方法、类方法和构造方法
  9. dubbo线程模型
  10. Git - 常见错误与解决方案
  11. Linux中非正常关闭vi编辑器产生swp文件怎么删除
  12. python 递归函数操作方法
  13. 27.Docker集群部署
  14. 20155216 Exp4 恶意代码分析
  15. EntityFrameWork 图解
  16. linux tftp 服务
  17. 创建NuGet包
  18. C#迭代器、装箱/拆箱、重载等
  19. animation和transition
  20. 【洛谷P2014】选课

热门文章

  1. P4720 【模板】扩展卢卡斯
  2. 论文笔记:Learning how to Active Learn: A Deep Reinforcement Learning Approach
  3. 微信发送红包示例(php)
  4. 非托管C++互操作
  5. 如何判断一个单向链表是否为回文链表(Palindrome Linked List)
  6. Python 全集变量
  7. ImgNoGoodWindow
  8. hdu 5724 Chess 博弈sg+状态压缩
  9. strtotime 获取之前,之后时间
  10. psql常用命令