SHAREPOINT & JQUERY
Hi, my name and I am a product manager at lightning tools. I have been working with SharePoint for 5 years.
The book I wrote
A bit about jQuery Basic jQuery Using jQuery with SharePoint Plugins jQuery considerations Questions Agenda
A BIT ABOUT JQUERY
jQuery is a cross-browser JavaScript library designed to simplify the client-side scripting of HTML
Write Less Do More
Release d 2006
Used by over 55% of the 10,000 most visited websites, jQuery is the most popular JavaScript library in use today
Free Open Source
Cross- browser support
FEATURES
DOM Selector s
Events
CSS Manipula tion
Effects and Animatio ns
Ajax Function ality
Extensibility through plug-ins
Utilities - such as the each function Features
GETTING STARTED WITH JQUERY
$(‘x’); Jquery(‘x’); jQuery Factory
$(document).ready(function() { // code goes here });
DOM Selector s
$('p') $(‘#firstName’) $(‘.edit’) $('p[title=“Welcome"]') $('p.task').add('p.otherTask')
DEMO
CSS Manipula tion
DEMO
Events
HTML File function doSomething() { alert(“You did something!”); } Click! The bad
HTML File Click! JavaScript File $(‘#clickMe').click(function(){ alert('You did something!'); }); The good
DEMO
Ajax Function ality
DEMO
Effects and Animatio ns
Utilities - such as the each function
Extensibi lity throu gh plug-ins
jQuery UI Widgets Animation Visual Effects
Thousands of community driven plugins Excellent documentation if you want to make them yourself Existing plugins include things such as Accordion Menu, Tag Clouds, Image Rotators, Lightboxes
SPServices “This is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use”
Creating your own plugin
DEMO
USING JQUERY WITH SHAREPOINT
jquery.com Download the version you want Content Delivery Network (CDN) Linking to copy on public server Where can I get it from?
jQuery.c om Download the version you want Linking to a Local copy Development and Production versions Inside Firewall Greater Control Requires deployment
Content Delivery Network (CDN) Link to the version you want or latest Linking to copy on public server Caching Highly available Requires Access to file through internet
Layouts folder WPResources Site Assets Document Library CDN Version Adding it to SharePoint
Reference in Master Page Reference in AdditionalPageHead Delegate Control Reference using Custom Actions using ScriptSrc Content Editor Web Part Application Page\Web Part directly Making available
CONSIDERATIO NS
Where is jQuery going to be hosted? How is the library going to be referenced? Does every page need to load it? How many times is the library being loaded? What happens if JavaScript is disabled on the client?
Where to get it from How to make it available Understanding how jQuery works Summary
QUESTIONS?