---
schema_version: "1"
id: 6b3c3395ec25f3486fe70f3bc571bf46fae5e80d145b8b35f34bb50b161f3bb3
title: Using JavaScript Libraries with Visualforce
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/javascript/pages-javascript-libraries.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-javascript-libraries.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 61b6296b08dbeb56ed7c89b4d3c89525dbf543bfc7908e7969f84e0084292430
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Using JavaScript Libraries with Visualforce

You can include JavaScript libraries in your Visualforce pages to take advantage of functionality provided by these libraries. The best way to include JavaScript libraries is by creating a static resource, and then including the library by adding an `<apex:includeScript>` component to your page.

For example, if you are using jQuery ([https://js.foundation/](https://js.foundation/)), create a static resource from the library called `jquery`, and then reference it in a page like this:

<!-- otherprops: resourceName=jquery -->
```apex_page
<apex:page>
    <apex:includeScript value="{!$Resource.jquery}"/>
</apex:page>

```

You can then use it in a page by adding a `<script>` to call functions from the library.

If you’re using a JavaScript library in a Visualforce page, and that library defines `$` as a special character, you’ll need to modify your JavaScript to override this usage. For example, with jQuery you can override the definition of `$` by using the `jQuery.noConflict()` function.

<!-- otherprops: resourceName=jquery apex_page -->
```markup
<apex:page >
<apex:includeScript value="{!$Resource.jquery}"/>
<html>
<head>
  <script>
    jQuery.noConflict();
    
    jQuery(document).ready(function() {    
        jQuery("a").click(function() {
          alert("Hello world, part 2!");
        });
    });
  </script>
</head>
...
</apex:page>
```

**note:** -   The use of third-party JavaScript libraries and frameworks is supported and encouraged by Salesforce. However, Salesforce can’t help you debug your JavaScript code, except as it specifically relates to Salesforce functionality.
-   Don’t use Ext JS versions less than version 3 on pages that use Chatter components, `<apex:enhancedList>`, `<knowledge:articleCaseToolbar>`, or `<knowledge:articleRendererToolbar>`.

