Skip to content

How to notify iframe in the parent window that all the scripts of yandex map has been loaded?

There is a cross-window iframe, which contains a link to index.php from another server, which, in turn, has a Yandex maps api script (see below). How to make sure that this script chain is fully loaded? I’m trying the following way:

            function loaded() {
                window.parent.postMessage('loaded', '*');
        <script src="" type="text/javascript"></script>
        <script src="" type="text/javascript" onload="loaded()"></script>
The message arrives, but the map is not displayed. Which, in my opinion, means incomplete loading of scripts.

Chain of yandex map scripts


Subscribe to ymaps.ready().

ymaps.ready(() => notify())