Answers.Body: <p>You would use <a href="https://developer.mozilla.org/en/docs/Web/HTML/Element/script" rel="noreferrer"><code>&lt;script&gt;</code></a> tags in your template, preferable in a _layout.html or _base.html template which you <a href="http://twig.sensiolabs.org/doc/tags/extends.html" rel="noreferrer"><code>extend</code></a> from all your other templates. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-17T11:26:16.953Z
Answers.Text: Thanks for your reply. I had a look at the source code of Craft. It looks like that Craft uses jquery and jquery UI, so I am thinking maybe we can use the jquery and jquery UI bundled in the default installation of Craft, but I am not sure if this is true and if this is true, how can I use the bundled jquery and jquery UI.
Answers.UserDisplayName: pumpum
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-17T11:36:05.783Z
Answers.Text: No, it's just in the package for the control panel and there's no easy or recommended way to use it for your front end templates.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-17T12:01:26.003Z
Answers.Text: There's really no good reason to use the bundled version of jQuery and jQuery UI – you're better off including your own, local files in the public root folder, or use a CDN. Also, you might find the [`{% includeJsFile %}`](https://craftcms.com/docs/templating/includejsfile) tag useful.
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-17T21:47:42.053Z
Answers.Text: Yeh I wouldn't use any CMS built-in front end files. You're now at the mercy of when Craft updates, you need to make sure your own front end code doesn't break in some weird way. There's rarely a security vulnerability with something like jquery that keeping an old version would put your site at risk. If you're used to something like WordPress, where the best practice IS to use that ancient version it comes with, consider this is a feature not a bug...
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-17T21:56:20.320Z
Answers.Text: @MatsMikkelRummelhoff and RitterKnight, thanks for contributing and making this answer actually helpful, now that we know what the OP was after.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-18T06:16:57.950Z
Answers.Text: Hi @MatsMikkelRummelhoff and RitterKnight, I really appreciate your explanation :)
Answers.UserDisplayName: pumpum
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-17T10:53:06.160Z
Answers.LastActivityDate: 2016-02-17T10:53:06.160Z
Answers.UserDisplayName: carlcs
Answers.Body: <p>This is one (of the many) great things about Craft. You can literally include any javascript library however you like. In general, if there is a library you want to use, you can simply follow the guide for that particular library.</p>
  
  <p>A traditional approach is to include jQuery in the <code>&lt;head&gt;</code> of your document, then any other scripts after.</p>
  
  <p>I personally use <a href="http://requirejs.org/" rel="nofollow">requirejs</a> for my projects. To do that, I follow the guide on the requriejs website. Generally, I'll do this on a <code>_layout.html</code> file that way it is included across all pages of my application.</p>
  
  <p>Because Craft doesn't force you to follow any tempting rules, you are free to use whatever-however you like.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-17T13:00:30.400Z
Answers.LastActivityDate: 2016-02-17T14:25:31.407Z
Answers.LastEditDate: 2016-02-17T14:25:31.407Z
Answers.UserDisplayName: Damon
Body: <p>I am wondering what is the correct way to include jQuery and jQuery UI in Craft?</p>
  
  <p>Thank you.</p>
  
Tags: <jquery>
Title: What is the correct way to include jQuery and jQuery UI in Craft?
ThreadText: # What is the correct way to include jQuery and jQuery UI in Craft?
  
  (Asked by: username_0 on 2016-02-17)
  
  I am wondering what is the correct way to include jQuery and jQuery UI in Craft?
  
  Thank you.
  
  **Tags:** jquery
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-02-17. Score: 5
  
  You would use [`<script>`](https://developer.mozilla.org/en/docs/Web/HTML/Element/script) tags in your template, preferable in a \_layout.html or \_base.html template which you [`extend`](http://twig.sensiolabs.org/doc/tags/extends.html) from all your other templates.
  
  > **Comments:**
  > **username_0**: Thanks for your reply. I had a look at the source code of Craft. It looks like that Craft uses jquery and jquery UI, so I am thinking maybe we can use the jquery and jquery UI bundled in the default installation of Craft, but I am not sure if this is true and if this is true, how can I use the bundled jquery and jquery UI.  
  > **username_1**: No, it's just in the package for the control panel and there's no easy or recommended way to use it for your front end templates.  
  > **username_2**: There's really no good reason to use the bundled version of jQuery and jQuery UI – you're better off including your own, local files in the public root folder, or use a CDN. Also, you might find the [`{% includeJsFile %}`](https://craftcms.com/docs/templating/includejsfile) tag useful.  
  > **username_3**: Yeh I wouldn't use any CMS built-in front end files. You're now at the mercy of when Craft updates, you need to make sure your own front end code doesn't break in some weird way. There's rarely a security vulnerability with something like jquery that keeping an old version would put your site at risk. If you're used to something like WordPress, where the best practice IS to use that ancient version it comes with, consider this is a feature not a bug...  
  > **username_1**: @username_2 and username_3, thanks for contributing and making this answer actually helpful, now that we know what the OP was after.  
  > **username_0**: Hi @username_2 and username_3, I really appreciate your explanation :)  
  
  ---
  
  ### Answer by username_4 on 2016-02-17. Score: 5
  
  This is one (of the many) great things about Craft. You can literally include any javascript library however you like. In general, if there is a library you want to use, you can simply follow the guide for that particular library.
  
  A traditional approach is to include jQuery in the `<head>` of your document, then any other scripts after.
  
  I personally use [requirejs](http://requirejs.org/) for my projects. To do that, I follow the guide on the requriejs website. Generally, I'll do this on a `_layout.html` file that way it is included across all pages of my application.
  
  Because Craft doesn't force you to follow any tempting rules, you are free to use whatever-however you like.
  
  
  ---
  
  