R
R
raxweb2019-11-22 03:20:27
JavaScript
raxweb, 2019-11-22 03:20:27

Yandex map is not displayed in the modal window, how to fix it?

On the internal page, Yandex Maps work fine, for example:
Internal page
I'm trying to display the same Yandex Maps code in a modal window, but the map is not displayed.
For example:
Catalog page with a modal window - the modal window opens when you click on the "Address", for example, the top "Address: Moscow, Dmitrovskoe shosse, 117k1".
The logic of the modal window is as follows:
1) The visitor clicks on the link.
2) A modal window opens.
3) A script with the map loading is inserted into the modal window in innerHTML.
Those. there is no map before the click, it is created by the php script after the link is clicked.
Tell me, please, what could be the matter here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kylin, 2019-11-22
@raxweb

The script with loading the map should be placed at the end of the page, under . Or wrap in
For code to be executed after page load

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question