views:

21

answers:

1

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?

Thanks

+1  A: 

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

Dr.Molle