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.
精彩评论