开发者

Override Alert Message from an IFrame?

I've been trying to capture the alert dialog of an iframe unsuccessfully. The iframe is on a different subdomain but the same domain.

This doesn't seem to log the output to Firebug from the iframe Alerts

function alert(message) {
        console.info(message);
    }

Do I need to reference the iframe by it's DOM layer somehow? Is window.alert specific to the entire DOM tree?

开发者_如何学JAVAThanks


If the iFrame is on a different subdomain, you can't override there anything out of the parent-window, according to same-origin-policy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜