How to solve the $ is not a function problem reported by js

Source: Internet
Author: User

Today, when I was working on a project, I encountered a very strange problem. I run a program in html well. If I run it in jsp project, the error $ is not a function is always reported. After searching for a long time, I tried a lot and did not solve it. Later, I suddenly thought about changing the order of the js files I introduced, and introducing the first js file of jquery, and putting other js files behind it. Solved the problem !!! It turns out that the imported files are loaded sequentially during page loading. If jquery's js file is not the first one to be introduced, the $. method name in other js will report an error. The $. method can be correctly executed only when jquery's js file is introduced first. Backup now!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.