title: Can't access iframe of different origin in the parent jsp
body: <p>Quick example for the kind of functionality required (just for exampple):</p>
  
  <p><a href="http://www.indeed.hk/cmp/Calvin-Klein-Jeans-&amp;-Calvin-Klein-Underwear/jobs/Part-Time-Sales-Associate-1643e24903d9f4c7" rel="nofollow">http://www.indeed.hk/cmp/Calvin-Klein-Jeans-&amp;-Calvin-Klein-Underwear/jobs/Part-Time-Sales-Associate-1643e24903d9f4c7</a></p>
  
  <p>If you click on apply-now button, it shows an iframe. </p>
  
  <p>I am having a project where I am trying to access an iframe of different origin, say <code>https: //subdomain.example.com</code>, on a jsp page of origin say <code>http://www.example.com</code> but it gives me the following error:</p>
  
  <blockquote>
    <p>Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin <a href="http://www.example.com" rel="nofollow">http://www.example.com</a> from accessing a frame with origin <a href="https://subdomain.example.com" rel="nofollow">https://subdomain.example.com</a>. The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.</p>
  </blockquote>
  
  <p>Lets call the parent jsp page as parent.jsp, and the iframe jsp as iframe.jsp.<br>
  parent.jsp is on server S, and the project name is xyznet<br>
  iframe.jsp is on server R, and the project name is xyz   </p>
  
  <p>Here is a piece of code from the <strong>parent.jsp</strong> </p>
  
  <pre><code>&lt;%
      java.util.Map model = (java.util.Map)pageContext.findAttribute("model");
  %&gt;
  &lt;html&gt;
   &lt;body&gt;
   &lt;h1&gt; This is the parent page
      &lt;iframe id="quick-apply-frame" name="iframe-name" src="       &lt;%=https: //sub.domain.com/apply.html?ref=${model.x.y}" onload="quickSetParams();"&gt;
      &lt;/iframe&gt;
  &lt;script&gt;
   function quickSetParams() {
   $("[name=iframe-name]").contents().find("[name=iframe-param-name]").val(${model.value1}');
  }
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And here is piece of code from the <strong>iframe.jsp</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form action="xyz.html"&gt;
      &lt;input name="iframe-parm-name" value=""/&gt;
       &lt;input name="iframe-parm-name2" value="${model.parm2}" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Handler which loads the iframe.jsp is a SimpleFormController, located on server R</p>
  
  <p>I have come across some solutions where the data is transferred directly using javascript, but I need a handler for this, and so, a direct javascript redirect or nesting of iframes would not work for me</p>