I understand that in order to fire the onscroll event handler in an iframe normally, the iframe must contain a site with the same domain name as the page that contains the iframe. But is there anyway at all that this can be done for an iframe that contains an external site?
The onscroll event handler:
<script type="text/javascript">
window.onload = function() {
var frm = document.getElementById("test").contentWindow;
frm.onscroll = function(){
alert("iframe scrolled");
}
}
</script>
The above js code works just fine for this:
<iframe id="test" src="http://www.<myDomain>.com"></iframe>
but not for this:
<iframe id="test" src="http://www.<anExternalSite>.com"></iframe>
If I can't do this my entire application will be useless. is there any workaround for doing this? any hack?