Home >Web Front-end >JS Tutorial >Solution to the problem of js reporting $ is not a function_javascript skills
While working on a project today, I encountered a super strange problem. My program in html ran fine, but when I ran it in jsp in the project, it kept getting $ is not a function errors. I've been looking for it for a long time and tried a lot, but can't find a solution. Later, it suddenly occurred to me to change the order of the js files I imported. The js file of jquery was introduced first, and other js files were placed behind it. Really solved the problem! ! ! It turns out that when the page loads, the imported files are loaded sequentially. If the js file of jquery is not introduced first, then the $. method name in other js will report an error. Only when the js file of jquery is introduced first can the $. method be executed correctly. Backup hereby!