0

i have working on idx plugin for property search.its a http link given to search property but i want to conver this link to https for that purpose i used <iframe> and i put https: link on iframe its working fine.

but problem happen with iframe content its content have a form which will action with http so i will also convert its https so have used jquery for that to change content of iframe but it will give me a error

Uncaught DOMException: Blocked a frame with origin "http://localhost" from accessing a cross-origin frame.

Iframe Code

<iframe src="https://www.idxhome.com/homesearch/xxxxx" width="100%" height="1750" frameborder="0" allowtransparency="true" id="foo" sandbox="allow-same-origin allow-scripts">

jquery code

  var iframe = document.getElementById("foo");
  var elmnt = iframe.contentWindow.document.getElementsByTagName("body");
  elmnt.style.display = "none";

iframe form content with http action i want change it https

<form id="ihf-contact-request-form" class="form-inline" data-ihf-event="contact-form-submit" action="http://www.idxhome.com/contact/submit/ajax/126024" method="POST" data-ihf-event-bound="true"> /form>

how i will do that i have try and search all things related to that but its have not working for me.

sideshowbarker
  • 62,215
  • 21
  • 143
  • 153
Bhargav Chudasama
  • 5,619
  • 2
  • 18
  • 32
  • I think its a CORS issue. try this once - https://coderwall.com/p/_ff9dg/enabling-cross-origin-resource-sharing-cors-on-google-chrome-for-javascript-api-calls-and-debugging-purposes – Bee Oct 11 '18 at 06:12
  • This will not work if the iframe contains content from another domain because of the Same Origin Policy – Shajibur Rahman Dec 02 '20 at 03:50

0 Answers0