강희주

Update main.html

......@@ -21,8 +21,11 @@
//request는 string으로 받아오기 때문에 JSON형태로 바꿔준다.
//var jsonObject = JSON.parse();
var LocationName = jsonObject.name; //지역 이름
document.getElementById("LocationName").innerHTML= LocationName;
var WeatherCondition = jsonObject.weather[0].main; //현재 날씨
document.getElementById("WeatherCondition").innerHTML= WeatherCondition;
var Temp = jsonObject.main.temp; //현재 기온
document.getElementById("Temp").innerHTML= Temp;
//console.log(body);
console.log(LocationName);
console.log(WeatherCondition);
......@@ -35,6 +38,7 @@
navigator.geolocation.getCurrentPosition(function(pos) {
$('#latitude').html(pos.coords.latitude);
$('#longitude').html(pos.coords.longitude);
// useGps(); // GPS 정보를 모두받아온 뒤에 코드를 실행함
useGps();
});
}
......@@ -85,6 +89,7 @@
clock();
setInterval(clock, 1000); // 1초마다 실행
</script>
</fieldset>
<fieldset>
......@@ -101,22 +106,9 @@
<fieldset>
<legend>추천 음악 정보</legend>
<div><input type="button" value="음악 추천 받기"></div><br>
<!-- <iframe id="video1" width="450" height="280" src="" frameborder="0" allowtransparency="true" allowfullscreen></iframe>
<a href="#" id="playvideo">Play button</a>
<script>
var userLat = 37;
var userLng = 127;
fetch("http://localhost:3000/music")
.then(res => res.json())
.then(function(data) {
$("#playvideo").click(function(){
$("#video1")[0].src += data.link;
});
})
</script> -->
<h4>추천 음악 1</h4>
<div id="div1"></div>
<iframe width="942" height="530" src="https://www.youtube.com/embed/vnS_jn2uibs" title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><br>
<h4>추천 음악 2</h4>
......