title: Cross Site Scripting Iframe Permission Denied issue
body: <p>I am getting Cross Site Scripting error on the following code. </p>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code> function resizeIframe(ifRef) 
              {
                  var ifDoc;
                  //alert(ifRef);
  
                  try
                  { 
                      ifDoc = ifRef.contentWindow.document.documentElement; 
                  }
                  catch( e )
                  {
                     alert(e);
                      try
                      { 
                      ifDoc = ifRef.contentDocument.documentElement; 
                      }
                      catch( ee ){
                               alert(ee);
                            } 
                  }
                  //var doc = ifRef.height;
                  //alert(doc);
                  if(ifDoc)
                  {
                      ifRef.height = 1; 
                      ifRef.style.height = ifDoc.scrollHeight+'px';               
                  }
              }
  </code></pre>
  
  <p><strong>Iframe</strong></p>
  
  <pre><code>&lt;iframe onload="resizeIframe(this)" style="margin-bottom: 16px;" src="ourteamnav/first.php" frameborder="0" scrolling="no" width="597" height="240"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>The Errors are following</p>
  
  <p><strong>For 'e' :</strong>                  </p>
  
  <p>Mozilla Firefox : <strong>Error: Permission denied to access property 'document'</strong></p>
  
  <p>Google Chrome :  <strong>TypeError: Cannot read property 'documentElement' of undefined</strong></p>
  
  <p>Internet Explorer : <strong>TypeError: Permission denied</strong></p>
  
  <p><strong>And for 'ee' :</strong></p>
  
  <p>Mozilla Firefox : <strong>Error: Permission denied to access property 'documentElement'</strong></p>
  
  <p>Google Chrome :  <strong>TypeError: Cannot read property 'documentElement' of null</strong></p>
  
  <p>Internet Explorer : <strong>Error: Access is denied.</strong></p>
  
  <p>I think it can not be solved in general way as it s happening because of domain is pointing another domain. So will anyone guide me to solve it without using these property of Javascript <code>contentDocument.documentElement</code> or <code>contentWindow.document.documentElement</code> for re-sizing the Iframe Content dynamically according to its inner Content.</p>
  
  <p>Thanks</p>