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:
<script> function loaded() { window.parent.postMessage('loaded', '*'); } </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" type="text/javascript"></script> <script src="https://api-maps.yandex.ru/2.1/?apikey=bla-bla-bla&lang=ru_RU" type="text/javascript" onload="loaded()"></script>
Advertisement
Answer
Subscribe to ymaps.ready()
. https://tech.yandex.com/maps/jsapi/doc/2.1/ref/reference/ready-docpage/
ymaps.ready(() => notify())