title: Cross domain iframe src changes
body: <p>I have an application which contains an iframe. I can modify the contents of the iframe, but not the whole page itself, e.g.:</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;
  &lt;body&gt; 
      &lt;iframe&gt;
          &lt;!-- my code --&gt;
      &lt;/iframe&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>I have a requirement in which I need to change contents of the iframe to a different page (possibly on a different domain) and go back. Currently I do it like this:
  The first page (it is inside the iframe executionPanelApplications):</p>
  
  <pre><code>&lt;html&gt; 
   &lt;head&gt;
      &lt;script type="text/javascript"&gt;
  function replaceIFrameUrl() {
      var doSubmit = "&lt;c:out value='${param.doSubmit}'/&gt;";
      if (doSubmit == 1) {
          document.forms['testForm'].submit();
      }
      else {
          var adfUrl = "&lt;fuego:fieldValue att='instJs.adfUrl' onlyValue='true'/&gt;";
          var bpmSrc = parent.document.getElementById('executionPanelApplications').src;
          var bpmSrcParams = bpmSrc.split('&amp;');
          var activityId = (bpmSrcParams[1].split('='))[1]; 
          var url = adfUrl +"&amp;actionType=0&amp;activityId="+activityId;
          parent.document.getElementById('executionPanelApplications').src = url;
      }
  };
  
  &lt;/script&gt;
   &lt;/head&gt;
   &lt;body onload="replaceIFrameUrl();"&gt;
      &lt;form method="post" id="testForm" name="testForm" /&gt;
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>The second page (it should be inside the iframe executionPanelApplications as well):</p>
  
  <pre><code> &lt;script&gt;
     function leave(e) {
        var iframe = parent.parent.document.getElementById("executionPanelApplications");
        iframe.src = url;
     };
   &lt;/script&gt;
  </code></pre>
  
  <p>If both sites are in localhost it works like a charm. Unfortunatelly if they are in different domains - the second page is opened in a new window. Tested in ie 8. As i said - i can't change the contents of the page that contains the iframe. I can only work from inside the iframe. I need this to work only in ie.</p>
  
  <p>Any ideas?</p>