how to add razor code in javascript code example
Example: razor pages and javascript
<!--HTML-->
@foreach(var item in Model)
{
<div data-marker="@Json.Encode(item)"></div>
}
<!--Javascript-->
$('[data-marker]').each(function() {
var markerData = $(this).data('marker');
addMarker(markerData.Latitude, markerData.Longitude,
markerData.Description, markerData.Title);
});