3

当我将它们加载到我的域中时,我想强制外部 3rd 方脚本(在单独的域上)使用我自己的 document.write 自定义实现。

IE:

document.write = function(args) {
    // My custom Function
    }

这适用于同一域上的脚本,但其他域上的脚本使用浏览器默认值。我可以覆盖这个吗?

4

1 回答 1

0

给你:

(window.HTMLDocument ? HTMLDocument.prototype : document).write = function(s) {
    this.title = s;
}

在 IE 和非 IE 中,“this”对象都是浏览器文档对象。

于 2009-05-29T20:58:01.090 回答