razor pages and javascript

Solutions on MaxInterview for razor pages and javascript by the best coders in the world

showing results for - "razor pages and javascript"
Isabell
07 Oct 2020
1<!--HTML-->
2@foreach(var item in Model)
3{
4    <div data-marker="@Json.Encode(item)"></div>
5}
6
7<!--Javascript-->
8$('[data-marker]').each(function() {
9    var markerData = $(this).data('marker');
10    addMarker(markerData.Latitude, markerData.Longitude,
11              markerData.Description, markerData.Title);
12});
13