
4-4 강의에서 ajax코드 api코드 복붙하고 줄도 맞췄는데
검사창에 나는 버튼이다 눌러도 아무런 메세지가 안뜹니다ㅜㅜ
저는 화살표 커서대신 동그란 회색 점으로 뜨는데 차이가 있나요?

작성한 코드 및 에러 메세지
App.py 파일
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/test', methods=['GET'])
def test_get():
title_receive = request.args.get('title_give')
print(title_receive)
return jsonify({'result': 'success', 'msg': '이 요청은 GET!'})
if __name__ == '__main__':
app.run('0.0.0.0', port=5000, debug=True)
app.py 실행창
C:\Users\user\Desktop\sparta\projects\prac\venv\Scripts\python.exe C:/Users/user/Desktop/sparta/projects/prac/app.py
* Serving Flask app 'app'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
* Running on http://192.168.1.101:5000
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: 108-868-128
127.0.0.1 - - [09/Oct/2022 23:53:11] "GET / HTTP/1.1" 200 -
index.html 파일
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
function hey() {
$.ajax({
type: "GET",
url: "/test?title_give=봄날은간다",
data: {},
success: function (response) {
console.log(response)
}
})
}
</script>
</head>
<body>
<h1>나의 첫 웹페이지</h1>
<button>버튼을 만들자</button>
</body>
</html>
