简体   繁体   中英

How do i use JQuery in an external JS file?

I want to reference JQuery in an external JS file. Since the code i will be using is going to be a script, i don't have a page to load it from.

Does anyone know how to load JQuery into a JS file without the use of a html page?

Sorry if this is already answered.

Thank You.

You can add <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

element to any webpage which already loaded before your external js file is loaded and use jQuery object in your external file. at runtime it will find the object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM