Bootstrap: uncaught "type error ajax is not a function" error after switching to the three new starter template scripts.

Created on 18 Jan 2017  路  5Comments  路  Source: twbs/bootstrap

I made the switch from alpha 5 to alpha 6 simply by swapping out the prior three starter template scripts, and putting the new ones in ( jquery-3.1.1.slim.min.js, tether 1.4.0 and of course alpha 6 via the cdn ). I got the scripts from this page: https://v4-alpha.getbootstrap.com/getting-started/introduction/

Incidentally (I hope), the prior jquery came from googleapis.com and was version 3.1.1.

I did not make any other changes anywhere else...simply put in the three new scripts in place of old. Now my ajax function generates Type error:

Uncaught TypeError: $.ajax is not a function
at HTMLAnchorElement. (?page=home:230)
at HTMLAnchorElement.dispatch (jquery-3.1.1.slim.min.js:3)
at HTMLAnchorElement.q.handle (jquery-3.1.1.slim.min.js:3)

I can "fix" this simply by swapping out the new scripts in place of the originals.

js v4

Most helpful comment

Use https://code.jquery.com/jquery-3.1.1.min.js instead, not sure what is the dependency of BS to "slim" :)

All 5 comments

Use https://code.jquery.com/jquery-3.1.1.min.js instead, not sure what is the dependency of BS to "slim" :)

Yes, I did switch back to that and it works fine with alpha 6 bootstrap scripts for js. Thanks.

Bootstrap only requires the slim build of jQuery. If you need to use features such as $.ajax, which are not included in the slim build, you should use the full build instead.

:)) Thanks

@bardiharborow Thanks !

Was this page helpful?
0 / 5 - 0 ratings