SlideShare a Scribd company logo
THE SHAREPOINT AND
JQUERY GUIDE
SharePoint Saturday St. Louis
Mark Rackley
mark.rackley@summit7systems.com
Summit 7 systems is a premier provider of consulting and implementation services specializing on the
Microsoft SharePoint Platform and FAST Enterprise Search.

»
»
»
»
»
»

Summit 7 Systems was chosen by KMWorld Magazine as one of the top 100 Companies that Matter in Knowledge Management along with
companies such as Microsoft, Oracle and IBM.
Summit 7 Systems was named to the 2011 and 2012 CRN Next-Gen 250 List as a company bringing innovative processes, methodologies and
models to the solution provider industry.
Top 1% of Microsoft Partners Worldwide
Summit 7 Systems was named #6 on the 2012 CRN Fast Growth 100 based on our 2009 – 2011 growth of over 930% per year.
~ 50% of Technical Staff hold US Government SECRET Clearances.
Service Disabled Veteran Owned Small Business (SDVOSB).
SOFTWARE PLATFORMS
FAST Enterprise Search
SharePoint 2007
SharePoint 2010
SharePoint 2013
Office Platform
Sitecore

SOLUTION AREAS
SharePoint Platform Solutions
Enterprise Search
Enterprise Content Management
Internet / Web Content Management
Extranet Solutions
Intranet Solutions
Business Process Management
Enterprise Project Management
Exchange Server

SERVICES
SharePoint QuickStart
Information Architecture and Governance Development
Upgrade and Migration
Branding and Design (User Experience)
Web Content Management Design and Deployment
SharePoint Search
Custom Workflow or Web Part Development
InfoPath Forms and Workflows
Performance Baselines and Best Practices Optimization
Mapping Business Process to Software Platforms
Cloud Services Design and Provisioning
Remote Support Contracts
Compliance Quickstart
MARK RACKLEY / SOLUTIONS ARCHITECT

• 18+ years software architecture and
development experience
• SharePoint Junkie since 2007
• Event Organizer
• Blogger, Writer, Speaker
• Bacon aficionado

@mrackley

http://www.sharepointhillbilly.com
AGENDA
•
•
•
•
•
•

What is jQuery? Why SharePoint & jQuery?
SharePoint and jQuery Basics
Deploying / Maintaining
Development Basics
Third Party Libraries
Examples & Demos
The SharePoint & jQuery Guide
http://bit.ly/jQueryAndSP
WHAT IS JQUERY?

• JavaScript Utility Library
•

jQuery() or $()

• Allows interaction and manipulation of the DOM after
page is rendered
• Can interact with other systems using Web Services
• Supported by Microsoft
• Part of “Client Side” Development
WHY SHAREPOINT & JQUERY?
•
•
•
•
•

Fewer upgrade/deployment issues
Rapid deployment and modifications
Less “customization”
Improved visuals
Improved usability
WHY SHAREPOINT & JQUERY?
•
•
•
•

Can replace the need for Visual Studio
Can replace the need for basic workflows
No points (shhhh… don’t tell the admins)
You can get around the ListView Threshold (but should
you??)
JQUERY & SHAREPOINT BASICS

• Scripts execute with same privileges as current user
• Permissions cannot be elevated
• Interact with SharePoint List data using Client Side Object
Model (CSOM), REST, or SPServices
WHY I HATE JAVASCRIPT & JQUERY (SOME DAYS)
var car = {
• Too many options
color: “red”,
make: “Jeep”,
model: “wrangler”
}

var car = {};
car.color = “red”;
car.make = “Jeep”;
car.model=“wranger”;

var car = {};
car*“color”+ = “red”;
car*“make”+ = “Jeep”;
car*“model”+ =“wranger”;
WHY I HATE JAVASCRIPT & JQUERY (SOME DAYS)
•
•
•
•
•
•

Too many options
Debugging is painful
Performance can suffer
Inconsistent results on different browsers
Constant changes in the jQuery library
It CAN harm your farm!
WHEN SHOULD YOU USE JQUERY?
•
•
•
•

Tightly controlled environments
Visuals or Usability are high priorities
Tight timeframes
Simple page and form modifications
›
›
›

•

Dynamic drop downs
Hiding page elements
Reading / populating fields

Why would you NOT use jQuery?
WHEN SHOULD YOU QUESTION THE USE OF JQUERY?
•
•
•
•
•

Need pull a lot of data over the wire to work with
Iterating over many rows of list data
Extended business logic or proprietary business logic
Privileges need to be elevated
Need to support many different browsers
DEPLOYMENT OPTIONS
• Document Library
<script type="text/javascript" src="/SiteAssets/jquery.min.js"></script>

• File System
<script type="text/javascript" src="/_layouts/scripts/jquery.min.js"></script>

• Content Delivery Network (CDN)
<script type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
DOCUMENT LIBRARY
REFERENCE OPTIONS
• ScriptLink
<SharePoint:ScriptLink runat="server" Name="/SiteAssets/jquery.min.js"
Localizable="false"></SharePoint:ScriptLink>

• Content Editor Web Part
•

Use the Content Link

• Custom Action
•

Feature, Deploys to Site Collection
CUSTOM ACTION

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
ScriptSrc="~sitecollection/SiteAssets/jquery.min.js"
Location="ScriptLink"
Sequence="100"
>
</CustomAction>
</Elements>
A WORD ABOUT MDS
Minimal Download Strategy (MDS)
• New in SharePoint 2013 / enabled by default in O365
• Reduces page load time by sending only the differences when users navigate to
a new page.
• https://sp_site/_layouts/15/start.aspx#/SitePages/newpage.aspx
• Can cause scripts referenced in Custom Actions and CEWPs to not be loaded
• Disable feature at site level if MDS is causing issues. Rework scripts based on
recommendations in order to use MDS.
DEVELOPMENT & DEBUGGING
•

Development
•

Visual Studio
•

•
•

•

Web Essentials

SharePoint Designer
Notepad++

Debugging
•
•
•
•
•

IE Developer Tools / Firebug
Fiddler
Alerts… alerts… alerts…
Avoid Console.log
Write scripts in small manageable chunks
COMMONLY USED JQUERY
METHODS IN SHAREPOINT
JQUERY BASICS
<script type="text/javascript">
$(document).ready(function($){
//this script executes after the page is loaded
//if you need to interact with the DOM put script here
})
//Script placed here would execute before the page is finished loading.
</script>
JQUERY BASICS
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
JQUERY BASICS
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>

//Retrieve the element by ID:
$(“#myID”);
JQUERY BASICS
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>

//Retrieve the element by attribute:
$(“div*attribute=‘myAttribute’+”);
JQUERY BASICS
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>

//Retrieve every div on the page
$(“div”).each(function() ,
//”this” is the current element in each loop
$(this).method();
});
//Hide all divs on the page
$(“div”).hide();
JQUERY BASICS
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
//Retrieve every div of a specific class
$(“div.myClass”).each(function() ,
//”this” is the current element in each loop
$(this).method();
});
//Hide all divs of a specific class on the page
$(“div.myClass”).hide();
//Hide all elements of a specific class on the page
$(“.myClass”).hide();
JQUERY BASICS
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>

//Retrieve the div that contains content “World”
$(“div:contains(‘World’)”).each(function() ,
//”this” is the current element in each loop
$(this).method();
});
JQUERY BASICS
<div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>

//Retrieve the formatted HTML for an element
$(“#myID”).html(); //returns <b>Hello World</b>
//Set the formatted HTML for an element
$(“#myID”).html(“<b>Hello Nurse</b>”);
//Retrieve the text with HTML formatting stripped out
$(“#myID”).text(); //returns Hello World
//Set the unformatted text of an element
$(“#myID”).text(“Hello Nurse”);
MORE JQUERY BASICS
//get input / select values
$(“#id”).val();
//set input / select values
$(“#id”).val(“value”);
//uncheck a check box
$(“#id").removeAttr('checked');
//check a check box
$(“#id").attr('checked','checked');
//is a check box checked?
if ($(“#id”).is(':checked'))
MORE JQUERY BASICS
<tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
MORE JQUERY BASICS
<tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
//get the row that contains the div “myElement”
$(“#myElement”).closest(“tr”);
//get the cell that contains the div “myElement”
$(“#myElement”).closest(“td”);
Or
$(“#myElement”).parent();
MORE JQUERY BASICS
<tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
//get the div AFTER myElement
$(“#myElement”).next(“div”);
Or
$(“#myElement”).next();
//get the div BEFORE myOtherelement
$(“#myOtherElement”).prev(“div”);
Or
$(“#myOtherElement”).prev();
CHAINING
//find the input element that has the “title” attribute equal to “Name”
//then find it’s parent cell’s previous cell. Then find the “h3” element and replace the HTML
$("input[title='Name']").closest("td").prev("td").find("h3").html("File Name <font color='red'>*</font>");
//In English: Find the label for the field “Name” and change it to “File Name” and add a red astrisk
//find the input element that has the “title” attribute equal to “City”
//then hide the entire row that contains the input
$(“input*title=‘City’+”).closest(“tr”).hide();
//In English: Hide the SharePoint Form Field and label for the field with the Display
//name “City”
HOW ABOUT SOME BEST PRACTICES?
•
•
•
•
•
•

Use the Element’s ID when possible
Reduce DOM searches
Re-use code / Good coding practices
Minimize files
Use animations to hide slow performance
Delay loading of Selects until you need the data
USING THIRD PARTY LIBRARIES
Tips for selection and integration
• Look for supported / documented libraries
• Test in target browsers before implementing
• Duplicate file structure
• Test “vanilla” in SharePoint first
USING THIRD PARTY LIBRARIES
Some of my favorites
•
•
•
•
•
•

Content Slider - http://unslider.com
Formatted Tables - http://www.datatables.net/
Modal Window - http://www.ericmmartin.com/projects/simplemodal/
SPServices - http://spservices.codeplex.com/
Calendar - http://arshaw.com/fullcalendar/
Forms 7 – http://forms7.codeplex.com
INTERACTING WITH SHAREPOINT FORMS
<input
name="ctl00$m$g_a12c0b73_06fa_4552_a5af_b5d5fce55384$ctl00$ctl05$ctl03$ctl00$ctl00$ctl04$ctl00$ctl00$Text
Field" type="text" maxlength="255"
id="ctl00_m_g_a12c0b73_06fa_4552_a5af_b5d5fce55384_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField"
id="ctl00_m_g_a12c0b73_06fa_4552_a5af_b5d5fce55384_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextFiel
title="E-mail Address" class=“ms-long ms-spellcheck-true" />
d" title="E-mail Address" class=“ms-long ms-spellcheck-true" />
<input
name="ctl00$m$g_a12c0b73_06fa_4552_a5af_b5d5fce55384$ctl00$ctl05$ctl03$ctl00$ctl00$ctl04$ctl00$ctl00$Text
Field" type="text" maxlength="255"
id="ctl00_m_g_a12c0b73_06fa_4552_a5af_b5d5fce55384_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextFiel
d" title="E-mail Address" class=“ms-long ms-spellcheck-true" />
$(“input[title=‘E-mail Address’+”); //returns element
DEMOS! – LET’S DO SOME STUFF!
FOR MORE FROM SUMMIT 7 SYSTEMS…
facebook.com/summit7systems

@summit7systems
summit 7 systems
summit7systems
summit7systems.com/blogs

More Related Content

What's hot (20)

PPTX
Intro to SharePoint Web Services
Mark Rackley
 
PPTX
Introduction to using jQuery with SharePoint
Rene Modery
 
PPTX
SPTechCon 2014 How to develop and debug client side code in SharePoint
Mark Rackley
 
PPTX
SharePoint & jQuery Guide - SPSTC 5/18/2013
Mark Rackley
 
PPTX
Introduction to StratusForms #SayNoToInfoPath
Mark Rackley
 
PPTX
Using jQuery to Maximize Form Usability
Mark Rackley
 
PPTX
A Power User's Intro to jQuery Awesomeness in SharePoint
Mark Rackley
 
PPTX
Introduction to Client Side Dev in SharePoint Workshop
Mark Rackley
 
PPTX
SPTechCon - Share point and jquery essentials
Mark Rackley
 
PPTX
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
PPTX
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
Mark Rackley
 
PPTX
SEF2013 - A jQuery Primer for SharePoint
Marc D Anderson
 
PPTX
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
Mark Rackley
 
PPTX
SharePoint REST vs CSOM
Mark Rackley
 
PPTX
SharePoint Saturday St. Louis - SharePoint & jQuery
Mark Rackley
 
PPTX
Transform SharePoint default list forms with HTML, CSS and JavaScript
John Calvert
 
PPTX
What is SharePoint Development??
Mark Rackley
 
PPTX
Content by query web part
IslamKhattab
 
PPTX
SEF2013 - Create a Business Solution, Step by Step, with No Managed Code
Marc D Anderson
 
PPTX
The SharePoint & jQuery Guide
Mark Rackley
 
Intro to SharePoint Web Services
Mark Rackley
 
Introduction to using jQuery with SharePoint
Rene Modery
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
Mark Rackley
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
Mark Rackley
 
Introduction to StratusForms #SayNoToInfoPath
Mark Rackley
 
Using jQuery to Maximize Form Usability
Mark Rackley
 
A Power User's Intro to jQuery Awesomeness in SharePoint
Mark Rackley
 
Introduction to Client Side Dev in SharePoint Workshop
Mark Rackley
 
SPTechCon - Share point and jquery essentials
Mark Rackley
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
Mark Rackley
 
SEF2013 - A jQuery Primer for SharePoint
Marc D Anderson
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
Mark Rackley
 
SharePoint REST vs CSOM
Mark Rackley
 
SharePoint Saturday St. Louis - SharePoint & jQuery
Mark Rackley
 
Transform SharePoint default list forms with HTML, CSS and JavaScript
John Calvert
 
What is SharePoint Development??
Mark Rackley
 
Content by query web part
IslamKhattab
 
SEF2013 - Create a Business Solution, Step by Step, with No Managed Code
Marc D Anderson
 
The SharePoint & jQuery Guide
Mark Rackley
 

Viewers also liked (20)

PPTX
What IS SharePoint Development?
Mark Rackley
 
DOCX
Parte vi. experto en diseño gráfico publicitario
Fátima Martín Abril
 
PPTX
Departing the Desk: Reference, Change and the Art of Letting Go
Chris Sweet
 
PPT
Unidadalimenta2
Jesusmanuel
 
PPTX
Abogados Campmany
Campmanyabogados
 
PDF
Fixura Annual Report 2014
Fixura
 
PPTX
El pacto de los alcaldes
schoolpepas
 
PDF
Entremés junio
Carla Collado
 
PPT
Roll To Roll Sublimation Printing Machine
Fei Yue Paper Industrial Co.,Ltd.
 
PPTX
TécTécnicas formales de evaluación
Kathy_Ona
 
PDF
Costa blanca es-2009
Manuela Del Mar
 
PDF
2013 블로그코디 홈로그 소개서
블로그코디
 
PDF
27 de agosto del 2014
Lilia Esther Valenzuela Zorrilla
 
PDF
Sinergie tra involucro e impianti.
minergie_svizzera_italiana
 
PDF
Comunicado Primer Meeting PhoneGap Spain
PhoneGap Spain
 
PDF
IFPRI Discussion Paper 01095
cenafrica
 
DOCX
Nariz del diablo alausí
Chave_Huilcarema
 
PPT
Hipertensión Pulmonar
Alvaro Campos
 
PPTX
PRECAUCIONES ELECTRICAS
juan182cuervos
 
PPTX
Normatividad de la web!
Laura Melisa Aguirre Dávila
 
What IS SharePoint Development?
Mark Rackley
 
Parte vi. experto en diseño gráfico publicitario
Fátima Martín Abril
 
Departing the Desk: Reference, Change and the Art of Letting Go
Chris Sweet
 
Unidadalimenta2
Jesusmanuel
 
Abogados Campmany
Campmanyabogados
 
Fixura Annual Report 2014
Fixura
 
El pacto de los alcaldes
schoolpepas
 
Entremés junio
Carla Collado
 
Roll To Roll Sublimation Printing Machine
Fei Yue Paper Industrial Co.,Ltd.
 
TécTécnicas formales de evaluación
Kathy_Ona
 
Costa blanca es-2009
Manuela Del Mar
 
2013 블로그코디 홈로그 소개서
블로그코디
 
27 de agosto del 2014
Lilia Esther Valenzuela Zorrilla
 
Sinergie tra involucro e impianti.
minergie_svizzera_italiana
 
Comunicado Primer Meeting PhoneGap Spain
PhoneGap Spain
 
IFPRI Discussion Paper 01095
cenafrica
 
Nariz del diablo alausí
Chave_Huilcarema
 
Hipertensión Pulmonar
Alvaro Campos
 
PRECAUCIONES ELECTRICAS
juan182cuervos
 
Normatividad de la web!
Laura Melisa Aguirre Dávila
 
Ad

Similar to The SharePoint & jQuery Guide - Updated 1/14/14 (20)

PPTX
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
SPTechCon
 
PPTX
SharePoint and jQuery Essentials
Mark Rackley
 
PPTX
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
Mark Rackley
 
PPTX
Spsemea j query
Mark Rackley
 
PPTX
SharePoint Cincy 2012 - jQuery essentials
Mark Rackley
 
PPTX
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
Mark Rackley
 
PPTX
SPSTC - SharePoint & jQuery Essentials
Mark Rackley
 
PPTX
Utilizing jQuery in SharePoint: Get More Done Faster
Mark Rackley
 
PPTX
Spsbe2012 sessie start to-jquery
Marijn Somers
 
PPTX
Power to the People: Manipulating SharePoint with Client-Side JavaScript
PeterBrunone
 
PDF
No Feature Solutions with SharePoint
mikehuguet
 
PPTX
Easy tabs, Slideshows, Dashboards, etc - Client Side Scripts for SharePoint
PathToSharePoint
 
PPTX
SharePoint and the User Interface with JavaScript
Regroove
 
PPTX
2012 - HTML5, CSS3 and jQuery with SharePoint 2010
Chris O'Connor
 
PDF
Pro Sharepoint With Jquery New Phill Duffy
spoorhesketw
 
PPTX
A Beginner's Guide to Client Side Development with Javascript
SharePoint Saturday New Jersey
 
PPTX
Share point development 101
Becky Bertram
 
PPTX
SPS Monaco 2017 - The Lay of the Land of Client-Side Development circa 2017
Marc D Anderson
 
PDF
jQuery Rescue Adventure
Allegient
 
PPTX
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Chris O'Brien
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
SPTechCon
 
SharePoint and jQuery Essentials
Mark Rackley
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
Mark Rackley
 
Spsemea j query
Mark Rackley
 
SharePoint Cincy 2012 - jQuery essentials
Mark Rackley
 
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
Mark Rackley
 
SPSTC - SharePoint & jQuery Essentials
Mark Rackley
 
Utilizing jQuery in SharePoint: Get More Done Faster
Mark Rackley
 
Spsbe2012 sessie start to-jquery
Marijn Somers
 
Power to the People: Manipulating SharePoint with Client-Side JavaScript
PeterBrunone
 
No Feature Solutions with SharePoint
mikehuguet
 
Easy tabs, Slideshows, Dashboards, etc - Client Side Scripts for SharePoint
PathToSharePoint
 
SharePoint and the User Interface with JavaScript
Regroove
 
2012 - HTML5, CSS3 and jQuery with SharePoint 2010
Chris O'Connor
 
Pro Sharepoint With Jquery New Phill Duffy
spoorhesketw
 
A Beginner's Guide to Client Side Development with Javascript
SharePoint Saturday New Jersey
 
Share point development 101
Becky Bertram
 
SPS Monaco 2017 - The Lay of the Land of Client-Side Development circa 2017
Marc D Anderson
 
jQuery Rescue Adventure
Allegient
 
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Chris O'Brien
 
Ad

More from Mark Rackley (7)

PPTX
Column Formatter in SharePoint Online
Mark Rackley
 
PPTX
SharePoint Conference North America - Converting your JavaScript to SPFX
Mark Rackley
 
PPTX
A Power User's Introduction to jQuery Awesomeness in SharePoint
Mark Rackley
 
PPTX
Citizen Developers Intro to jQuery Customizations in SharePoint
Mark Rackley
 
PPTX
A Power User's intro to jQuery awesomeness in SharePoint
Mark Rackley
 
PDF
NOW I Get it!! What SharePoint IS and why I need it
Mark Rackley
 
PPTX
Wrapping your head around the SharePoint Beast (For the rest of us)
Mark Rackley
 
Column Formatter in SharePoint Online
Mark Rackley
 
SharePoint Conference North America - Converting your JavaScript to SPFX
Mark Rackley
 
A Power User's Introduction to jQuery Awesomeness in SharePoint
Mark Rackley
 
Citizen Developers Intro to jQuery Customizations in SharePoint
Mark Rackley
 
A Power User's intro to jQuery awesomeness in SharePoint
Mark Rackley
 
NOW I Get it!! What SharePoint IS and why I need it
Mark Rackley
 
Wrapping your head around the SharePoint Beast (For the rest of us)
Mark Rackley
 

Recently uploaded (20)

PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Biography of Daniel Podor.pdf
Daniel Podor
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 

The SharePoint & jQuery Guide - Updated 1/14/14

  • 1. THE SHAREPOINT AND JQUERY GUIDE SharePoint Saturday St. Louis Mark Rackley [email protected]
  • 2. Summit 7 systems is a premier provider of consulting and implementation services specializing on the Microsoft SharePoint Platform and FAST Enterprise Search. » » » » » » Summit 7 Systems was chosen by KMWorld Magazine as one of the top 100 Companies that Matter in Knowledge Management along with companies such as Microsoft, Oracle and IBM. Summit 7 Systems was named to the 2011 and 2012 CRN Next-Gen 250 List as a company bringing innovative processes, methodologies and models to the solution provider industry. Top 1% of Microsoft Partners Worldwide Summit 7 Systems was named #6 on the 2012 CRN Fast Growth 100 based on our 2009 – 2011 growth of over 930% per year. ~ 50% of Technical Staff hold US Government SECRET Clearances. Service Disabled Veteran Owned Small Business (SDVOSB).
  • 3. SOFTWARE PLATFORMS FAST Enterprise Search SharePoint 2007 SharePoint 2010 SharePoint 2013 Office Platform Sitecore SOLUTION AREAS SharePoint Platform Solutions Enterprise Search Enterprise Content Management Internet / Web Content Management Extranet Solutions Intranet Solutions Business Process Management Enterprise Project Management Exchange Server SERVICES SharePoint QuickStart Information Architecture and Governance Development Upgrade and Migration Branding and Design (User Experience) Web Content Management Design and Deployment SharePoint Search Custom Workflow or Web Part Development InfoPath Forms and Workflows Performance Baselines and Best Practices Optimization Mapping Business Process to Software Platforms Cloud Services Design and Provisioning Remote Support Contracts Compliance Quickstart
  • 4. MARK RACKLEY / SOLUTIONS ARCHITECT • 18+ years software architecture and development experience • SharePoint Junkie since 2007 • Event Organizer • Blogger, Writer, Speaker • Bacon aficionado @mrackley http://www.sharepointhillbilly.com
  • 5. AGENDA • • • • • • What is jQuery? Why SharePoint & jQuery? SharePoint and jQuery Basics Deploying / Maintaining Development Basics Third Party Libraries Examples & Demos The SharePoint & jQuery Guide http://bit.ly/jQueryAndSP
  • 6. WHAT IS JQUERY? • JavaScript Utility Library • jQuery() or $() • Allows interaction and manipulation of the DOM after page is rendered • Can interact with other systems using Web Services • Supported by Microsoft • Part of “Client Side” Development
  • 7. WHY SHAREPOINT & JQUERY? • • • • • Fewer upgrade/deployment issues Rapid deployment and modifications Less “customization” Improved visuals Improved usability
  • 8. WHY SHAREPOINT & JQUERY? • • • • Can replace the need for Visual Studio Can replace the need for basic workflows No points (shhhh… don’t tell the admins) You can get around the ListView Threshold (but should you??)
  • 9. JQUERY & SHAREPOINT BASICS • Scripts execute with same privileges as current user • Permissions cannot be elevated • Interact with SharePoint List data using Client Side Object Model (CSOM), REST, or SPServices
  • 10. WHY I HATE JAVASCRIPT & JQUERY (SOME DAYS) var car = { • Too many options color: “red”, make: “Jeep”, model: “wrangler” } var car = {}; car.color = “red”; car.make = “Jeep”; car.model=“wranger”; var car = {}; car*“color”+ = “red”; car*“make”+ = “Jeep”; car*“model”+ =“wranger”;
  • 11. WHY I HATE JAVASCRIPT & JQUERY (SOME DAYS) • • • • • • Too many options Debugging is painful Performance can suffer Inconsistent results on different browsers Constant changes in the jQuery library It CAN harm your farm!
  • 12. WHEN SHOULD YOU USE JQUERY? • • • • Tightly controlled environments Visuals or Usability are high priorities Tight timeframes Simple page and form modifications › › › • Dynamic drop downs Hiding page elements Reading / populating fields Why would you NOT use jQuery?
  • 13. WHEN SHOULD YOU QUESTION THE USE OF JQUERY? • • • • • Need pull a lot of data over the wire to work with Iterating over many rows of list data Extended business logic or proprietary business logic Privileges need to be elevated Need to support many different browsers
  • 14. DEPLOYMENT OPTIONS • Document Library <script type="text/javascript" src="/SiteAssets/jquery.min.js"></script> • File System <script type="text/javascript" src="/_layouts/scripts/jquery.min.js"></script> • Content Delivery Network (CDN) <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  • 16. REFERENCE OPTIONS • ScriptLink <SharePoint:ScriptLink runat="server" Name="/SiteAssets/jquery.min.js" Localizable="false"></SharePoint:ScriptLink> • Content Editor Web Part • Use the Content Link • Custom Action • Feature, Deploys to Site Collection
  • 17. CUSTOM ACTION <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction ScriptSrc="~sitecollection/SiteAssets/jquery.min.js" Location="ScriptLink" Sequence="100" > </CustomAction> </Elements>
  • 18. A WORD ABOUT MDS Minimal Download Strategy (MDS) • New in SharePoint 2013 / enabled by default in O365 • Reduces page load time by sending only the differences when users navigate to a new page. • https://sp_site/_layouts/15/start.aspx#/SitePages/newpage.aspx • Can cause scripts referenced in Custom Actions and CEWPs to not be loaded • Disable feature at site level if MDS is causing issues. Rework scripts based on recommendations in order to use MDS.
  • 19. DEVELOPMENT & DEBUGGING • Development • Visual Studio • • • • Web Essentials SharePoint Designer Notepad++ Debugging • • • • • IE Developer Tools / Firebug Fiddler Alerts… alerts… alerts… Avoid Console.log Write scripts in small manageable chunks
  • 21. JQUERY BASICS <script type="text/javascript"> $(document).ready(function($){ //this script executes after the page is loaded //if you need to interact with the DOM put script here }) //Script placed here would execute before the page is finished loading. </script>
  • 22. JQUERY BASICS <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div>
  • 23. JQUERY BASICS <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve the element by ID: $(“#myID”);
  • 24. JQUERY BASICS <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve the element by attribute: $(“div*attribute=‘myAttribute’+”);
  • 25. JQUERY BASICS <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve every div on the page $(“div”).each(function() , //”this” is the current element in each loop $(this).method(); }); //Hide all divs on the page $(“div”).hide();
  • 26. JQUERY BASICS <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve every div of a specific class $(“div.myClass”).each(function() , //”this” is the current element in each loop $(this).method(); }); //Hide all divs of a specific class on the page $(“div.myClass”).hide(); //Hide all elements of a specific class on the page $(“.myClass”).hide();
  • 27. JQUERY BASICS <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve the div that contains content “World” $(“div:contains(‘World’)”).each(function() , //”this” is the current element in each loop $(this).method(); });
  • 28. JQUERY BASICS <div id=“myID” attribute=“myAttribute” class=“myClass” ><b>Hello World</b></div> //Retrieve the formatted HTML for an element $(“#myID”).html(); //returns <b>Hello World</b> //Set the formatted HTML for an element $(“#myID”).html(“<b>Hello Nurse</b>”); //Retrieve the text with HTML formatting stripped out $(“#myID”).text(); //returns Hello World //Set the unformatted text of an element $(“#myID”).text(“Hello Nurse”);
  • 29. MORE JQUERY BASICS //get input / select values $(“#id”).val(); //set input / select values $(“#id”).val(“value”); //uncheck a check box $(“#id").removeAttr('checked'); //check a check box $(“#id").attr('checked','checked'); //is a check box checked? if ($(“#id”).is(':checked'))
  • 30. MORE JQUERY BASICS <tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr>
  • 31. MORE JQUERY BASICS <tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr> //get the row that contains the div “myElement” $(“#myElement”).closest(“tr”); //get the cell that contains the div “myElement” $(“#myElement”).closest(“td”); Or $(“#myElement”).parent();
  • 32. MORE JQUERY BASICS <tr id=‘myRow’><td><div id=‘myElement’></div><div id=‘myOtherElement’></div></td></tr> //get the div AFTER myElement $(“#myElement”).next(“div”); Or $(“#myElement”).next(); //get the div BEFORE myOtherelement $(“#myOtherElement”).prev(“div”); Or $(“#myOtherElement”).prev();
  • 33. CHAINING //find the input element that has the “title” attribute equal to “Name” //then find it’s parent cell’s previous cell. Then find the “h3” element and replace the HTML $("input[title='Name']").closest("td").prev("td").find("h3").html("File Name <font color='red'>*</font>"); //In English: Find the label for the field “Name” and change it to “File Name” and add a red astrisk //find the input element that has the “title” attribute equal to “City” //then hide the entire row that contains the input $(“input*title=‘City’+”).closest(“tr”).hide(); //In English: Hide the SharePoint Form Field and label for the field with the Display //name “City”
  • 34. HOW ABOUT SOME BEST PRACTICES? • • • • • • Use the Element’s ID when possible Reduce DOM searches Re-use code / Good coding practices Minimize files Use animations to hide slow performance Delay loading of Selects until you need the data
  • 35. USING THIRD PARTY LIBRARIES Tips for selection and integration • Look for supported / documented libraries • Test in target browsers before implementing • Duplicate file structure • Test “vanilla” in SharePoint first
  • 36. USING THIRD PARTY LIBRARIES Some of my favorites • • • • • • Content Slider - http://unslider.com Formatted Tables - http://www.datatables.net/ Modal Window - http://www.ericmmartin.com/projects/simplemodal/ SPServices - http://spservices.codeplex.com/ Calendar - http://arshaw.com/fullcalendar/ Forms 7 – http://forms7.codeplex.com
  • 37. INTERACTING WITH SHAREPOINT FORMS <input name="ctl00$m$g_a12c0b73_06fa_4552_a5af_b5d5fce55384$ctl00$ctl05$ctl03$ctl00$ctl00$ctl04$ctl00$ctl00$Text Field" type="text" maxlength="255" id="ctl00_m_g_a12c0b73_06fa_4552_a5af_b5d5fce55384_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" id="ctl00_m_g_a12c0b73_06fa_4552_a5af_b5d5fce55384_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextFiel title="E-mail Address" class=“ms-long ms-spellcheck-true" /> d" title="E-mail Address" class=“ms-long ms-spellcheck-true" /> <input name="ctl00$m$g_a12c0b73_06fa_4552_a5af_b5d5fce55384$ctl00$ctl05$ctl03$ctl00$ctl00$ctl04$ctl00$ctl00$Text Field" type="text" maxlength="255" id="ctl00_m_g_a12c0b73_06fa_4552_a5af_b5d5fce55384_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_ctl00_TextFiel d" title="E-mail Address" class=“ms-long ms-spellcheck-true" /> $(“input[title=‘E-mail Address’+”); //returns element
  • 38. DEMOS! – LET’S DO SOME STUFF!
  • 39. FOR MORE FROM SUMMIT 7 SYSTEMS… facebook.com/summit7systems @summit7systems summit 7 systems summit7systems summit7systems.com/blogs