Skip to content

Conversation

@Chu03
Copy link

@Chu03 Chu03 commented Apr 29, 2025

No description provided.

Copy link

@Gwak-Seungju Gwak-Seungju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api를 잘 불러와 사용했네요!! 수고하셨습니다~!

Comment on lines +13 to +15
<div class="input_Container">
<input id="Country_Input" type="text" placeholder="국가를 영어로 작성해주세요.">
<button id="search_Btn">검색하기</button>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snake와 camel case 중 하나만 사용하면 좋을 듯 싶습니다.

저는 class명을 지을 때 snake case를 사용합니다.

Comment on lines +1 to +3
let CountryName=document.getElementById("Country_Input")
let searchBtn=document.getElementById("search_Btn")
let resultBox = document.getElementById("result");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

보통 변수명은 소문자로 시작합니다!

Comment on lines +10 to +23
fetch(`https://restcountries.com/v3.1/name/${CountryName.value}`)
.then(response => response.json())

.then(data => {
const countryInformation=data[0];
const flag=countryInformation.flags.png;
const capital=countryInformation.capital[0]

resultBox.innerHTML = `
<h2>${CountryName.value}</h2>
<img src="${flag}" alt="${CountryName.value} 국기" width="200">
<p>수도: ${capital}</p>
`;
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다음 실습에서는 async / await 이라는 키워드를 사용해서 구현해보면 좋을 것 같아요~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants