about using the Seajs times error: uncaught referenceerror: $ is not defined

Source: Internet
Author: User
Tags jquery library

Without the use of Seajs modularity, there is no problem referencing jquery.

Later when using Seajs for modularity, when the introduction of jquery plug-ins, always reported such errors, the online search for the following reasons is probably:

The path to the 1.jquery library file is incorrect, and checking the file path is correct in general to resolve the error.
2. If the path to the library file is correct, then it is possible to load the jquery library file in HTML in the wrong order, which can be resolved if the jquery library file is loaded at the very beginning.

And then put the jquery library file in the HTML there is no this problem, but I still want to use SEAJS to manage jquery, do not want to expose jquery to the outside, then use the following methods:

Write inside the module file:

Window.jquery = window.$ = require ("JQuery");
Tried, feasible, do not know that there is no better way to recommend the solution

about using the Seajs times error: uncaught referenceerror: $ is not defined

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.