송민준의 개발노트

$.ajax is not a function(jQuery 에러) 본문

웹/jQuery`

$.ajax is not a function(jQuery 에러)

송민준 2020. 2. 26. 01:30

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>