256 Kilobytes

Answers in Scripting and Automation | By Some Guy

Published

363 views, 0 RAMs, and 1 comment

Tags: Scripting, JavaScript, Errors, Programming, TypeError

Profile Photo - Some GuySome GuyBasic Subscriber

Hey. I'm new to JavaScript and have been enjoying coding in it so far. But, this error popped up on my screen today. It says that "$(...) modal is not a function?" How can I make it a function? Also, the error type is an Uncaught TypeError if that helps. Thanks!

Download more RAM. 🐏 ⨉ 0Posted by Some Guy 1 year ago 🕓 Posted at 13 January, 2019 06:01 AM PST

This is a debug account.

Profile Photo - Defaultwalemark

The $(…).modal is not a function is usually caused because scripts are loaded in the wrong order . The browser will execute the scripts in the order it finds them.

For example, bootstrap depends on jQuery , so jQuery must be referenced first. So, you must called the jquery.min.js and then bootstrap.min.js like the following:
 
<script src="/jquery-3.3.1.min.js"></script>
<script src="/bootstrap.min.js"></script>

Multiple jQuery instances

Sometimes this warning may also be shown if jQuery is declared more than once in your code. The second jQuery declaration prevents bootstrap.js from working correctly. The problem is due to having jQuery instances more than one time. Take care if you are using many files with multiples instance of jQuery. Just leave one instance of jQuery and your code will work.

Download more RAM. 🐏 ⨉ 0Posted by walemark 3 months ago 🕓 Posted at 24 August, 2020 04:07 AM PDT

Post a New Comment

Do you like having a good time?

Register an Account

You can also login to an existing account or reset your password. All use of this site is subject to the terms of service and privacy policy.

Read Quality Articles

Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.

View Articles →

Argue with People on the Internet

Use your account to explain why people are wrong on the Internet forum.

View Forum →

Vandalize the Wiki

Or don't. I'm not your dad.

View Wiki →

Ask and/or Answer Questions

If someone asks a terrible question, post a LMGTFY link.

View Answers →

Make Some Money

Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.

Register an Account

Answers— Read More

Find more related content below!