Highlighted

aem touch UI - document.domain is not working

anjaneyas306245

16-05-2018

Hi,

I am using document.domain for for get iframe url's current page on subdomain which is working fine classic UI, same code line is failing in aem touch UI the whole page is hanging with this line of code If i remove document.domain it is working fine.Does anyone knows some workaround to correct this?

Here is code snippet

<script>

    var anonymousUrl = "<%=anonymousUrl%>";

  var loginUrl = "<%=loginUrl%>";

    document.domain = "mydomain.com";

    function IframeLoaded() {

      var iFrameID = document.getElementById('idIframe');    

      var size=iFrameID.contentWindow.document.body.scrollHeight;

      if(iFrameID) {          

          iFrameID.height = "";

          iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";

      } 

    }

</script>