jQuery UI: TypeError: $(…).accordion is not a function

十年热恋 提交于 2019-12-03 23:19:25

This problem could arise from a couple of different things:

  • You are not including jQuery UI library.
  • You are including jQuery UI library above the inclusion of jQuery library
  • The path to jQuery UI and jQuery libraries might be incorrect
  • You are using a custom jQuery UI library that does not have an accordion

Since the first two do not apply to you, I would recommend triple-checking the path and using a full jQuery UI library instead of the custom one:

<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
Vivek España

Using two jquery.js files may cause a conflict and result in an errorbeing thrown. Avoid importing two or more jquery.js files.

in your last code lines, include the script in below order :-

There is no need to include the below as it will be taken care by above scripts.

The order of the js files matters!

/external/jquery/jquery.js should be listed above jquery-ui.js!
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!