1

Is there any way to put data from DB into the script?

I bring the data to JavaScript

<c:forEach var="map" items="${LHRankMap}">
   <tr>
        <td>${map.loca}</td>
        <!-- latitude -->
    <td>${map.la}</td>
        <!-- longitude-->
    <td>${map.lo}</td>
   </tr>  
</c:forEach>

enter image description here

It appears on the web well...
But I want to put the data to script

<script>
// I wnat to use loop for put my data(latitude, longitude) to below like that 
// var markerPosition  = new kakao.maps.LatLng(${map.la}, ${map.lo});

// this is the original code
var markerPosition  = new kakao.maps.LatLng(35.233242, 128.86656);
</script>

Is it possible?...

I tried to find some code on Google,
I couldn't find it...

HoRn
  • 1,458
  • 5
  • 20
  • 25
hayley
  • 45
  • 5
  • Please, edit your question to keep it free from phrases like "it is hard for me", "please help!!!!", "sorry for bad explain..". In the tutorial [ask] they are called nothing other than noise because they have no relation to the question – HoRn Nov 03 '22 at 05:48
  • @hayley Does [this](https://stackoverflow.com/a/6577321/1261766) help? – ave Dec 20 '22 at 15:25

0 Answers0