search

Home  >  Q&A  >  body text

jQuery reference error - Stack Overflow

I want to import the jquery package, but the browser reports an error. What is the reason?
**Uncaught ReferenceError: $ is not defined

at a.js:1

(anonymous) @ a.js:1**

欧阳克欧阳克2706 days ago852

reply all(2)I'll reply

  • 三叔

    三叔2017-07-05 10:42:02

    a.js depends on jquery. You need to introduce jquery first and then a.js. Take a look at the page to see if it is in this order.
    Additional explanation I tried it on chrome and it worked.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-07-05 10:42:02

    $ is not defined, which means it has not been introduced successfully. Pay attention to the js reference order, jQuery should be placed first

    reply
    0
  • Cancelreply