Created
November 9, 2012 22:19
-
-
Save ralphcallaway/4048689 to your computer and use it in GitHub Desktop.
Salesforce component for adding jQuery to a visualforce page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:component > | |
<apex:attribute name="version" | |
type="String" | |
required="false" | |
description="Version of jquery. Defaults to 1.8.2. See https://developers.google.com/speed/libraries/devguide#jquery for a full list of available versions" | |
default="1.8.2"/> | |
<apex:attribute name="minified" | |
type="Boolean" | |
required="false" | |
description="Indicate whether to use minified version. Defaults to true." | |
default="true"/> | |
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/{!version}/jquery.{!IF(minified,'min.','')}js"/> | |
<script> | |
j$ = jQuery.noConflict(); | |
</script> | |
</apex:component> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment