A
A
ALexLancer2020-04-28 06:24:13
API
ALexLancer, 2020-04-28 06:24:13

How to get access to JS API of yandex-map installed via IFRAME?

Added a map widget to the site. The loading of the map is delayed when the page is scrolled. The iframe src attribute is set to the value from data-src. After loading the map, I need to access its API. For some reason, there is no access to the ymaps object. Tried through a timer of 10 seconds, still does not see this object. Tell me where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2020-04-28
@loonny

No way. Restrictions are in the browser for security. You cannot access an iframe with a domain other than yours. Why would you use an iframe? Read the Yandex.Maps documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question