- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2019 12:05 PM
Hi there,
I am using an iframe in Service portal widget to load page from another application. I have a requirement to use window.postMessage() to post a message from the widget (client script) to the child window. From the client script I tried to access the content window using $window.frames[index].contentWindow but it does not seem to work.
Can someone please suggest me how to achieve this?
Thanks in advance,
Vinu
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2019 12:21 PM
I'd recommend you to use $window.document.querySelector or $window.document.getElementById or $window.document.querySelectorAll to query iframe element, which content you need to access. For example, if your custom Service Portal page has only one iframe, you can use $window.document.querySelector("iframe").contentWindow to access the contentWindow. Alternatively, angular.element("iframe")[0].contentWindow should work too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2019 09:47 PM
Hi,
How to post a message from our snow page when it is being accessed by another third party tool ?
