One of the big problems we have when it comes to web security are the dreaded “cross-site scripting” attacks. Something that browsers like IE (Internet Explorer) solve with the default denial of access to scripts that are hosted on domains other than those of our application. Something that other browsers have not chosen to carry from the beginning.

This leads us to the fact that if we have to embed our development within a third-party iframe, both hosted on different servers, our application will work perfectly in Firefox, Safari, ….. but not in IE, giving us the “Access is denied” error to that script.

The solution is much simpler than what we have read on other sites (1 and 2), we will simply have to add the following script to our page or master page (depending on where it suits us):

<scripttype= “text/javascript”>

if (Sys.Browser.agent == Sys.Browser.InternetExplorer){

                Sys.UI.DomElement.getLocation=function(a){

                if(a.self||a.nodeType===9)

                    return new Sys.UI.Point(0,0);

                var b=a.getBoundingClientRect();

                if(!b)

                    return new Sys.UI.Point(0,0);

                var c=a.document.documentElement,d=b.left-2+c.scrollLeft,e=b.top-2+c.scrollTop;

                try{

                    var g=a.ownerDocument.parentWindow.frameElement||null;

                    if(g){

                        var f=2-(g.frameBorder||1)*2;

                    d+=f;e+=f

                    }

               }catch(h){}

               return new Sys.UI.Point(d,e)}};

</script>

I hope it is useful to you, and the different policies and interpretations of each browser do not drive you crazy.