인프런 커뮤니티 질문&답변
ajax 질문 있습니다.
작성
·
201
0
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
   
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Spring MVC02</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  <script type="text/javascript">
  	$(document).ready(function()){
  		loadList();
  	});
  	function loadList(){
  		//서버와 통신 : 게시판 리스트 가져오기
  		$.ajax({
  			url : "boardList.do",
  			type : "get",
  			dataType : "json",
  			success : makeView,
  			error : function(){ alert("error"); }
  		});
  	}
  	function makeView(data){
  		alert(data);
  	}
  </script>
</head>
<body>
 
<div class="container">
  <h2>Spring MVC02</h2>
  <div class="panel panel-default">
    <div class="panel-heading">BOARD</div>
    <div class="panel-body">Panel Content</div>
    <div class="panel-footer">김성규</div>
  </div>
</div>
</body>
</html>

위와같이 선생님과 코드를 똑같이 만들었고 오류메시지도 출력되는게 없는데
localhost:8081내용 : 이런 메세지창이 뜨지 않습니다
따로 설정해야하는게 있는건가요?







( function() ) 이렇게 function()을 감싸는거라고 생각하고 맞는것으로 잘못봤습니다
감사합니다.