Answer the question
In order to leave comments, you need to log in
How to pass data from server js to client js?
Good day to all. I recently started learning node.js and to consolidate my knowledge I am doing a small project. The essence is a simple directory of places on the map with directories. It is written in node.js, express, and 2gis maps (based on leaflet).
Question - how to transfer an array of data to maps? After all, they are spinning on the js client side, and the template engine (Hogan) passes data to html tags, but not to <script>
. Please forgive my ignorance on some issues.
Answer the question
In order to leave comments, you need to log in
A script is also a tag and you can render data into it in the form of a json string or in the form of js code tokens in the same way as you render them anywhere else.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question