![]() ![]() So Instead of document.URL it's better to use. Html iframe Postmessage from html to wix page How can we make the product better Wishlist Page is the official platform for requesting new features. Update: docuent.URL can become a problem, when you use queries or links with location (#anchor) since your current url will become different from the one of the iframe source. If you control both, its much easier and this example will cover such use-case. The window. data that is sent over those messages needs to be serialized, its tricky to start communication because most of the time your arent sure what loaded first: main window or an iframe. In the iFrame: parent.postMessage(JSON.stringify(),'*') main window and an iframe can exchange data using postMessages. My simple problem is, that i can not identify the iFrame inside of it's parent callback method. PostMessage used incorrectly could potentially make your website vulnerable for crosssite-scripting attacks. I have control over both sides but the content comes from two different domains. The window.postMessage () method enables cross-origin communication between a window object and an embedded iFrame and therefore provides a mechanism to circumvent this restriction. Iframe and parent window postMessage communication Posted on DecemQuite common situation is that we place part of the content of our site in IFRAME tag which is linked with another page, typically, in the same domain as our main page. PS: I know it is probably best to avoid iFrames, however for the purpose of my application, this is necessary to use. I must accomplish it in this way using postMessage(). postMessage - send messages between iframes and windows -, postMessage, Ive heard nothing yet, Code used in this page, view source print 01. I am having a lot of trouble accomplishing this. I use postMessage to send events from an iframe to it's parent document. Then, I want to show an iFrame of the localhost:8000/(someid) in the localhost:3000 page. ![]()
0 Comments
Leave a Reply. |