0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

jQueryのバージョン上げたらUncaught TypeError: $ is not a functionが出た

Last updated at Posted at 2024-01-17

今回はkintoneでjQueryのバージョンを新しくしたら「Uncaught TypeError: $ is not a function」っていうエラーが出た

エラーの原因

jQueryのバージョンアップで$の扱いが変わっていたのが原因。だから$を使うところでエラーが出る。

解決策

$の代わりにjQueryって書けば問題なく動いた

  • 古いコード:$(セレクタ)
  • 新しいコード:jQuery(セレクタ)

追記
(function($){

})(jQuery);

にすれば$をjQueryと見なす(実際には即時関数の引数$にjQueryを渡しているだけ)という意味になるので中身の$変えなくても大丈夫でしたしこっちの方が楽でした。

0
0
2

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?