LoginSignup
3
2

More than 3 years have passed since last update.

ー初心者でもわかるエラー解決ー Uncaught TypeError: $.ajax is not a function の解決方法

Posted at

Uncaught TypeError: $.ajax is not a functionとは?

bootstrapを導入した上でjavascriptを使った非同期通信を実装しているときにエラーが発生しました。

#Uncaught TypeError: $.ajax is not a function

$.ajaxが使えない?jQuery入れてるのに?そんなバナナ、、、

見つけました。bootstrapで導入したjqueryがslim版だったため、ajaxの機能が使えなかったようです。

%script{crossorigin: "anonymous", integrity: "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo", src: "https://code.jquery.com/jquery-3.3.1.slim.min.js"}

下記に変更したらエラー解決しました。

%script{crossorigin: "anonymous", integrity: "sha384-3ceskX3iaEnIogmQchP8opvBy3Mi7Ce34nWjpBIwVTHfGYWQS9jwHDVRnpKKHJg7", src: "https://code.jquery.com/jquery-3.1.1.min.js"}

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2