0

So I have code that uses the contentWindow property to access the WiX.com in the iframe, but the domains are different. I am trying to access data in one h3 element, and that's it. The wixsite.com site I can access. I am doing this as a terrible form of API because I don't know how any server databases work.

Please be free to flip my code on its head, but all I need is data that is stored and can be seen in an h3 element.

If anyone wants me to use postMessage to get data from child to parent, I need to know how to do that in the WiX editor as well.

function myFunction() {
  var iframe = document.getElementById("myFrame");
  var elmnt = iframe.contentWindow.document.getElementByTagName('h3').innerHTML;
  console.log(elmnt);
}
<iframe id="myFrame" src="https://user.wixsite.com/" style="height:300px;width:80%"></iframe>
<button onclick="f()">test</button>
Penny Liu
  • 15,447
  • 5
  • 79
  • 98

0 Answers0