Issue
I'm wondering if there's a way in JavaScript/AngularJS to essentially look out for a message of some sort when it appears in an iframe. So say for example I have a form in an iframe, and I complete the form and it tells me I've completed it, is there a way to detect this via JS?
Any help/suggestions would be greatly appreciated.
Solution
Outside iframe listen event
window.addEventListener( "message",
function (e) {
alert(e.data);
},false);
Within iframe trigger event
window.postMessage('form complete');
Answered By - maddygoround
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.