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...

2
  • 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 How to Ask they are called nothing other than noise because they have no relation to the question Commented Nov 3, 2022 at 5:48
  • @hayley Does this help? Commented Dec 20, 2022 at 15:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.