본문 바로가기
목차
JQuery

jquery를 가져올때 (난 cdn) slim으로 가져왔다. ajax미지원

by 지각생 2022. 2. 22.
728x90

ajax를 사용해서 테스트를 해보는데 $.ajax is not a function 에러가 발생했다.

 

아래 스택오버플로우를 참고했다.

https://stackoverflow.com/questions/18271251/typeerror-ajax-is-not-a-function

 

TypeError: $.ajax(...) is not a function?

I'm trying to create a simple AJAX request which returns some data from a MySQL database. Here's my function below: function AJAXrequest(url, postedData, callback) { $.ajax() ({ type: ...

stackoverflow.com

원인은 jquery를 가져올때 (난 cdn) slim으로 가져왔다.

 slim 으로 가져오게 될 경우 ajax는 지원을 안해주나보다.

그래서 기본적인 모드를 가져왔다.

<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
728x90

댓글