https://apis.map.kakao.com/web/sample/keywordList/
위 예제를 사용하였습니다.
예제에서
function displayInfowindow(marker, title) {
var content = ‘<div style=“padding:5px;z-index:1;”>’ + title + ‘</div>’;
infowindow.setContent(content);
infowindow.open(map, marker);
}
부분을
function displayInfowindow(marker, title, places) {
var content = ‘<div style=“padding:5px;z-index:1;”>’ + title + ‘</div>’;
content += '<form>' +
'<input type="button" value="저장" onClick="messege_print(' + places.plcaes_name + ');">' +
'</form>';
infowindow.setContent(content);
infowindow.open(map, marker);
}
function message_print(places_name){
alert(“저장되었습니다.”);
}
로 수정을 하여 사용하려 합니다.
근데 이상하게 alret창이 뜨지 않아, onclick안의 places.places_name을 places.x로 하니
잘 작동 하더라구요.
왜인지, 해결법은 무엇인지 여쭙고자 작성합니다ㅠㅠ