Ask Your Question
1

How to invoke an IIFE declared in the parent window from an IFrame within Dynamics CRM?

asked 2023-02-13 11:00:00 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-10-04 23:00:00 +0000

djk gravatar image

To invoke an IIFE declared in the parent window from an IFrame within Dynamics CRM, you can use the parent object to access the function. For example:

In the parent window:

(function() {
    var myFunction = function() {
         alert("Hello from parent window!");
    };
    myFunction();
})();

In the IFrame:

parent.myFunction();

This will trigger the alert message defined in the parent window. Note that you should only access the parent window if the IFrame and parent window are within the same domain, to prevent security issues.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-02-13 11:00:00 +0000

Seen: 9 times

Last updated: Oct 04 '21