HEELPBOOK - SharePoint - The Best Way to Add Custom JavaScript and jQuery ########################################### During extensive SharePoint user interface customization you'll likely encounter a scenario where you need to make a web part or user control do something it was not intended to do or have a look that cannot be accomplished using the CSS hooks provided out-of-the-box. The solution is to create a custom master page and include a reference to a JavaScript file where you can modify the Document object. While straight JavaScript will do, I prefer to use the jQuery JavaScript library, which is far more robust, easier to use, and allows for plugins. Follow the steps below to add jQuery to your master page. * Go to jquery.com and download the latest jQuery library to your desktop. You want to get the compressed production version, not the development version. * Open SharePoint Designer (SPD) and connect to the root level of your site's site collection. * In SPD, open the "Style Library" folder. * Create a folder named "Scripts" inside of the Style Library. * Drag the jQuery library JavaScript file from your desktop into the Scripts folder. * In the Scripts folder, create a new JavaScript file and name it (e.g. "actions.js"). * Open your master page file in SPD. Within the tag of the master page, add a script reference to the jQuery library just above the content place holder named "PlaceHolderAdditonalPageHead" (and above your custom CSS references, if applicable) as follows: Immediately after the jQuery library reference add a script reference to your custom scripts file as follows: Your custom master page now includes jQuery and a reference to your custom scripts file where you can add jQuery scripts. SharePoint includes a number of JavaScript files throughout the site, so be careful that the scripts you add do not conflict with SharePoint's; the jQuery library itself does not conflict with SharePoint. ############ ARTICLE INFO ############# Article Month: July Article Date: 10/07/2012 Permalink: http://heelpbook.altervista.org/2012/sharepoint-the-best-way-to-add-custom-javascript-and-jquery/ Source: http://fitandfinish.ironworks.com/2010/01/the-best-way-to-add-custom-javascript-and-jquery-to-sharepoint.html Language: English View more articles on: http://www.heelpbook.net/ Follow us on Facebook: http://it-it.facebook.com/pages/HeelpBook/100790870008832 Follow us on Twitter: https://twitter.com/#!/HeelpBook Follow us on RSS Feed: http://feeds.feedburner.com/Heelpbook Follow us on Delicious: http://delicious.com/heelpbook