cagin cagin - 1 year ago 117
jQuery Question

how to include jquery in another javascript file

I have a javascript file and I want to include jquery in this js file. Do you have a suggestion?

Answer Source

Simply include the JavaScript for jQuery before you include your own JavaScript:

<script src="//"></script>
<script src="path/to/your/script.js"></script>

Though others have suggested simply copying and pasting jQuery into your own JavaScript file, it's really better to include jQuery separately from a canonical source as that will allow you to take advantage of the caching that your browser and intermediate servers have done for that file.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download