728x90
리스트 태그들을 추가해주는 버튼을 추가했다. 그런데 버튼을 누르면 아래와 같은 에러가 발생했다.
버튼의 코드는 이렇다.
<button
onclick='getNews()'
type='button'
class='btn btn-outline-secondary mb-3'>Scan the world
</button>
해결
...
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
function getNews() {
$.ajax({
type: "GET",
url: "localhost:3000/news",
data: {},
success: function(response) {
console.log(response);
}
})
}
</script>
</body>
...
728x90
'Research > HTML' 카테고리의 다른 글
HTML_basics (0) | 2023.05.02 |
---|---|
HTML_introduction (0) | 2023.05.02 |
HTML_JS fetchAPI로 서버 데이터 호출 후 HTML에 출력하기 (0) | 2023.04.14 |
process_프론트에서 서버로 이미지 전송하기(HTML->multer-Express) (0) | 2023.01.19 |
HTML5 boilerplate에 대해 (0) | 2022.10.12 |
댓글