SlideShare ist ein Scribd-Unternehmen logo
1 von 37
March 16, 2012
• Open wireless access is available.

  • Feel free to Tweet (#SPcincy2012) and blog during the
    session.




#SPcincy2012 on Twitter
www.sharepointcincy.com
Thanks to our Title & Platinum Sponsors




#SPcincy2012 on Twitter
www.sharepointcincy.com
Solutions Architect / SharePoint Practice
Lead / Developer

Email: mrackley@gmail.com
Blog: http://www.sharepointhillbilly.com
Twitter: @mrackley




         www.sharepointcincy.com
   What is jQuery and Why should I care?
   jQuery Overview
   Deployment & Development
   Interacting with SharePoint & the DOM
   Reading / Writing SharePoint List Data
   Using Third Party Libraries
   Demos




                                       5
   What / Why jQuery?
    ◦ JavaScript utility library supported by Microsoft
    ◦ Don‟t have to crack open Visual Studio or deploy
      solutions (ideal for SharePoint online and tightly
      controlled environments)
    ◦ It‟s the future
   What skills do you need?
    ◦ JavaScript
    ◦ CSS, XML
    ◦ A development background
      It IS code
      Uses development constructs
      If you can‟t write code, your ability to do magic will be
       limited to what you can copy/paste
    ◦ CAML, CAML, CAML… Sorry…
    ◦ Ability to think outside the box
      Use all the pieces together
Resolves many common SharePoint complaints
  without having to crack open Visual Studio
“It looks like SharePoint”
“That‟s SharePoint?”
“I‟m so sorry… SharePoint can‟t do that out of the box”
“Sure, no problem”
“That will take 3 weeks???” becomes “2 days?
Awesome! I love you… here, please accept this
bonus for being such a wonderful developer”
   What you need to be aware of
    ◦ It is secure
       It uses SharePoint‟s security. All scripts run with privileges of
        current user
    ◦ It performs well… if done correctly
       Reduce postbacks
       Can delay queries more effectively
    ◦ Privileges
       They can not be elevated… thank goodness…
   What you need to be careful of
    ◦ It can perform horribly
      Executes on client computer
      Don‟t send too much data over the wire
      Minify your scripts
    ◦ Inconsistent results
      Different browsers
      Network speed
      Client machine differences
    ◦ Changes in the jQuery library
    ◦ It CAN harm your farm!
JavaScript          Description
Classes / Objects   var myCar = {
                       id: 1,
                       make: “Jeep”,
                       model: “Wrangler”,
                       color: “Silver”
                    }

                    var vehicles = {};

                    vehicles[myCar.ID] = myCar;
For each loops      For (car in vehicles)
                    {
                      var thisCar = vehicles[car];
                    }
.split()            Var numbers = “1,2,3,4,5”;
                    Var myArray = numbers.split(“,”);
                    myArray[0] == “1”
.replace()          var myString = “This string has spaces”;
                    var newString = myString.replace(“ “,””);
                    newString == “Thisstringhasspaces”;
Method                           Description

$(document).ready(function($){   Where code execution begins after page is loaded
})
$(“#ElementID”)                  Returns element with given id

$(“Type[attrib=„value‟]”)        Gets element of specific type and attribute value
                                 $(“input[Title=„First Name‟]”)
.show(), .hide(), .toggle()      Shows, hides, toggles

.html()                          Gets the raw html for an element with tags

.text()                          Contents of an element with HTML tags stripped out
Method                             Description

.each(function() {})               Iterate through all elements that are found.
                                   $(“tr”).each(function() { }) would iterate through every row
                                   on the page.
.closest(selector)                 Get the first element that matches the selector, beginning
                                   at the currently element and progressing UP the DOM
                                   $("input[title=„Field Name']").closest("tr").hide();
.contains()                        Check to see if a DOM element is within another DOM
                                   element
.find()                            Get the child elements of current element, filtered by a
                                   selector




Chaining:
$("#WebPartWPDnn").find("nobr b:contains('Sum = ')").html().split(" = ")[1].replace(",","");
   Deployment Options
    ◦ Document Library
        Easily modify scripts
        Keep track of changes with Metadata
        Recover from screw ups with Versioning
        Less control, more flexibility versus other options
    ◦ File System
      Deployed with a WSP (don‟t think of manually copying)
      Not an option for Office 365 or hosted SharePoint
       2010
    ◦ CDN
   ScriptLink
      MasterPages, Delegate Controls, Web Parts, Controls,
       Custom Pages
      Ensures Script is not loaded multiple times
      Renders in the correct place in the markup
      Need Visual Studio or SPD
      More upfront work
   Content Editor Web Part (CEWP)
      Quick & Easy
      Don‟t have to deploy anything
      Adds CEWP overhead
   Custom Action
      Loads Script for entire Site Collection
      Works in sandbox

<?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>
   Development Tools
    ◦ IDE
      Visual Studio
      Notepad++
      SharePoint Designer
    ◦ Debugging
        IE Developer Tools
        Chrome debugger
        Fiddler
        Alerts… lots and lots of alerts
        Avoid Console.log (or use it wisely)
   View the DOM to understand what elements
    and classes exist on the page.
   “View page source” (Chrome) and “View
    Source” (IE) displays the contests of the DOM
    when the page is initially loaded.
   The DOM is always being modified, view the
    active DOM in your chosen debugger to view
    the DOM as it currently exists.
Getting/Setting SharePoint Form Fields
  Text Boxes
      ◦ $(“input[title=‟My Text Field‟]”).val()
     Selects
      ◦ $(“select[title=‟My Choice‟]”).val(mySelectValue);
     Checkboxes
      ◦ $("input[title='My Check
        box']").removeAttr('checked');
      ◦ $("input[title='My Check
        box']").attr('checked','checked');
http://sharepointhillbilly.com/archive/2011/08/20/a-dummies-guide-to-
sharepoint-and-jqueryndashgetting-amp-setting-sharepoint.aspx
   SPServices vs. Client Object Model
Feature                                    SPServices   COM
Allows CRUD against SharePoint List Data   Yes          Yes
Works in SharePoint 2007                   Yes          No
Works in SharePoint 2010                   Yes          Yes
Works with Anonymous Access                Yes          No
Comes with additional helper functions     Yes          Yes
Works cross-site                           Yes          No
   Tips for selection and integration
    ◦   Look for supported / document libraries
    ◦   Test in target browsers before implementing
    ◦   Duplicate file structure
    ◦   Test “vanilla” in SharePoint first
   Some of my favorites
    ◦ Content Slider -
      http://www.awkwardgroup.com/sandbox/awkwa
      rd-showcase-a-jquery-plugin/
    ◦ Formatted Tables - http://www.datatables.net/
    ◦ Modal Window -
      http://www.ericmmartin.com/projects/simplemo
      dal/
    ◦ SPServices - http://spservices.codeplex.com/
    ◦ Calendar - http://arshaw.com/fullcalendar/
And Nifty Stuff
   You don‟t have to be a SharePoint Guru
   It‟s Cheap
   It‟s Quick
   It‟s Easy
   It gets the job done
   Don‟t abuse it, You‟ll pay for it later
   Limited choices
   There are healthier options
   Adds page bloat
   Can slow your performance
Don’t drink the
     haterade…



Mark Rackley
mrackley@juniper-strategy.com
www.twitter.com/mrackley
www.sharepointhillbilly.com

                                34
 Dfdasf adsf
       Please complete and turn in your Session
       Evaluation Form as your entry for Prizes at
       the end of event prize raffle.

       Presenter:
          Speaker Name

       Session Name:
         Name of Session

#SPcincy2012 on Twitter
www.sharepointcincy.com
•Remember to visit the exhibit hall.

   •Get to know your user groups to find out about local
   activities and events in your area.

   •Make sure you stick around for the closing session
   and turn in your evaluation forms to be eligible for
   the prize raffles.



#SPcincy2012 on Twitter
www.sharepointcincy.com
#SPcincy2012 on Twitter
www.sharepointcincy.com

Weitere ähnliche Inhalte

Was ist angesagt?

fuser interface-development-using-jquery
fuser interface-development-using-jqueryfuser interface-development-using-jquery
fuser interface-development-using-jquery
Kostas Mavridis
 

Was ist angesagt? (20)

Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 
jQuery Introduction
jQuery IntroductionjQuery Introduction
jQuery Introduction
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
Learn css3
Learn css3Learn css3
Learn css3
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuery
 
fuser interface-development-using-jquery
fuser interface-development-using-jqueryfuser interface-development-using-jquery
fuser interface-development-using-jquery
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQuery
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
Nothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive WebNothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive Web
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePoint
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
The Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQueryThe Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQuery
 
jQuery besic
jQuery besicjQuery besic
jQuery besic
 

Ähnlich wie SharePoint Cincy 2012 - jQuery essentials

SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014
Mark Rackley
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
Mark Rackley
 

Ähnlich wie SharePoint Cincy 2012 - jQuery essentials (20)

SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
 
SPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuideSPSNH 2014 - The SharePoint & jQueryGuide
SPSNH 2014 - The SharePoint & jQueryGuide
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery Guide
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechConThe SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
 
jQuery
jQueryjQuery
jQuery
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have known
 
SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014SharePoint & jQuery Guide - SPSNashville 2014
SharePoint & jQuery Guide - SPSNashville 2014
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
SEF2013 - A jQuery Primer for SharePoint
SEF2013 - A jQuery Primer for SharePointSEF2013 - A jQuery Primer for SharePoint
SEF2013 - A jQuery Primer for SharePoint
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePoint
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Spsemea j query
Spsemea   j querySpsemea   j query
Spsemea j query
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 

Mehr von Mark Rackley

SharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFXSharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFX
Mark Rackley
 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery Libraries
Mark Rackley
 
What is SharePoint Development??
What is SharePoint Development??What is SharePoint Development??
What is SharePoint Development??
Mark Rackley
 

Mehr von Mark Rackley (20)

Column Formatter in SharePoint Online
Column Formatter in SharePoint OnlineColumn Formatter in SharePoint Online
Column Formatter in SharePoint Online
 
SharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFXSharePoint Conference North America - Converting your JavaScript to SPFX
SharePoint Conference North America - Converting your JavaScript to SPFX
 
A Power User's Introduction to jQuery Awesomeness in SharePoint
A Power User's Introduction to jQuery Awesomeness in SharePointA Power User's Introduction to jQuery Awesomeness in SharePoint
A Power User's Introduction to jQuery Awesomeness in SharePoint
 
Utilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done FasterUtilizing jQuery in SharePoint: Get More Done Faster
Utilizing jQuery in SharePoint: Get More Done Faster
 
Citizen Developers Intro to jQuery Customizations in SharePoint
Citizen Developers Intro to jQuery Customizations in SharePointCitizen Developers Intro to jQuery Customizations in SharePoint
Citizen Developers Intro to jQuery Customizations in SharePoint
 
A Power User's intro to jQuery awesomeness in SharePoint
A Power User's intro to jQuery awesomeness in SharePointA Power User's intro to jQuery awesomeness in SharePoint
A Power User's intro to jQuery awesomeness in SharePoint
 
A Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePointA Power User's Intro to jQuery Awesomeness in SharePoint
A Power User's Intro to jQuery Awesomeness in SharePoint
 
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
 
Introduction to StratusForms #SayNoToInfoPath
Introduction to StratusForms #SayNoToInfoPathIntroduction to StratusForms #SayNoToInfoPath
Introduction to StratusForms #SayNoToInfoPath
 
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
SPTechCon Boston 2015 - Overcoming SharePoint LimitationsSPTechCon Boston 2015 - Overcoming SharePoint Limitations
SPTechCon Boston 2015 - Overcoming SharePoint Limitations
 
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesTulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery Libraries
 
Using jQuery to Maximize Form Usability
Using jQuery to Maximize Form UsabilityUsing jQuery to Maximize Form Usability
Using jQuery to Maximize Form Usability
 
The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14The SharePoint & jQuery Guide - Updated 1/14/14
The SharePoint & jQuery Guide - Updated 1/14/14
 
SharePoint REST vs CSOM
SharePoint REST vs CSOMSharePoint REST vs CSOM
SharePoint REST vs CSOM
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013
 
NOW I Get it!! What SharePoint IS and why I need it
NOW I Get it!! What SharePoint IS and why I need itNOW I Get it!! What SharePoint IS and why I need it
NOW I Get it!! What SharePoint IS and why I need it
 
What is SharePoint Development??
What is SharePoint Development??What is SharePoint Development??
What is SharePoint Development??
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

SharePoint Cincy 2012 - jQuery essentials

  • 2. • Open wireless access is available. • Feel free to Tweet (#SPcincy2012) and blog during the session. #SPcincy2012 on Twitter www.sharepointcincy.com
  • 3. Thanks to our Title & Platinum Sponsors #SPcincy2012 on Twitter www.sharepointcincy.com
  • 4. Solutions Architect / SharePoint Practice Lead / Developer Email: mrackley@gmail.com Blog: http://www.sharepointhillbilly.com Twitter: @mrackley www.sharepointcincy.com
  • 5. What is jQuery and Why should I care?  jQuery Overview  Deployment & Development  Interacting with SharePoint & the DOM  Reading / Writing SharePoint List Data  Using Third Party Libraries  Demos 5
  • 6. What / Why jQuery? ◦ JavaScript utility library supported by Microsoft ◦ Don‟t have to crack open Visual Studio or deploy solutions (ideal for SharePoint online and tightly controlled environments) ◦ It‟s the future
  • 7. What skills do you need? ◦ JavaScript ◦ CSS, XML ◦ A development background  It IS code  Uses development constructs  If you can‟t write code, your ability to do magic will be limited to what you can copy/paste ◦ CAML, CAML, CAML… Sorry… ◦ Ability to think outside the box  Use all the pieces together
  • 8. Resolves many common SharePoint complaints without having to crack open Visual Studio
  • 9. “It looks like SharePoint”
  • 11. “I‟m so sorry… SharePoint can‟t do that out of the box”
  • 13. “That will take 3 weeks???” becomes “2 days? Awesome! I love you… here, please accept this bonus for being such a wonderful developer”
  • 14.
  • 15. What you need to be aware of ◦ It is secure  It uses SharePoint‟s security. All scripts run with privileges of current user ◦ It performs well… if done correctly  Reduce postbacks  Can delay queries more effectively ◦ Privileges  They can not be elevated… thank goodness…
  • 16. What you need to be careful of ◦ It can perform horribly  Executes on client computer  Don‟t send too much data over the wire  Minify your scripts ◦ Inconsistent results  Different browsers  Network speed  Client machine differences ◦ Changes in the jQuery library ◦ It CAN harm your farm!
  • 17. JavaScript Description Classes / Objects var myCar = { id: 1, make: “Jeep”, model: “Wrangler”, color: “Silver” } var vehicles = {}; vehicles[myCar.ID] = myCar; For each loops For (car in vehicles) { var thisCar = vehicles[car]; } .split() Var numbers = “1,2,3,4,5”; Var myArray = numbers.split(“,”); myArray[0] == “1” .replace() var myString = “This string has spaces”; var newString = myString.replace(“ “,””); newString == “Thisstringhasspaces”;
  • 18. Method Description $(document).ready(function($){ Where code execution begins after page is loaded }) $(“#ElementID”) Returns element with given id $(“Type[attrib=„value‟]”) Gets element of specific type and attribute value $(“input[Title=„First Name‟]”) .show(), .hide(), .toggle() Shows, hides, toggles .html() Gets the raw html for an element with tags .text() Contents of an element with HTML tags stripped out
  • 19. Method Description .each(function() {}) Iterate through all elements that are found. $(“tr”).each(function() { }) would iterate through every row on the page. .closest(selector) Get the first element that matches the selector, beginning at the currently element and progressing UP the DOM $("input[title=„Field Name']").closest("tr").hide(); .contains() Check to see if a DOM element is within another DOM element .find() Get the child elements of current element, filtered by a selector Chaining: $("#WebPartWPDnn").find("nobr b:contains('Sum = ')").html().split(" = ")[1].replace(",","");
  • 20. Deployment Options ◦ Document Library  Easily modify scripts  Keep track of changes with Metadata  Recover from screw ups with Versioning  Less control, more flexibility versus other options ◦ File System  Deployed with a WSP (don‟t think of manually copying)  Not an option for Office 365 or hosted SharePoint 2010 ◦ CDN
  • 21.
  • 22. ScriptLink  MasterPages, Delegate Controls, Web Parts, Controls, Custom Pages  Ensures Script is not loaded multiple times  Renders in the correct place in the markup  Need Visual Studio or SPD  More upfront work  Content Editor Web Part (CEWP)  Quick & Easy  Don‟t have to deploy anything  Adds CEWP overhead
  • 23. Custom Action  Loads Script for entire Site Collection  Works in sandbox <?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>
  • 24. Development Tools ◦ IDE  Visual Studio  Notepad++  SharePoint Designer ◦ Debugging  IE Developer Tools  Chrome debugger  Fiddler  Alerts… lots and lots of alerts  Avoid Console.log (or use it wisely)
  • 25. View the DOM to understand what elements and classes exist on the page.  “View page source” (Chrome) and “View Source” (IE) displays the contests of the DOM when the page is initially loaded.  The DOM is always being modified, view the active DOM in your chosen debugger to view the DOM as it currently exists.
  • 26. Getting/Setting SharePoint Form Fields  Text Boxes ◦ $(“input[title=‟My Text Field‟]”).val()  Selects ◦ $(“select[title=‟My Choice‟]”).val(mySelectValue);  Checkboxes ◦ $("input[title='My Check box']").removeAttr('checked'); ◦ $("input[title='My Check box']").attr('checked','checked'); http://sharepointhillbilly.com/archive/2011/08/20/a-dummies-guide-to- sharepoint-and-jqueryndashgetting-amp-setting-sharepoint.aspx
  • 27. SPServices vs. Client Object Model Feature SPServices COM Allows CRUD against SharePoint List Data Yes Yes Works in SharePoint 2007 Yes No Works in SharePoint 2010 Yes Yes Works with Anonymous Access Yes No Comes with additional helper functions Yes Yes Works cross-site Yes No
  • 28. Tips for selection and integration ◦ Look for supported / document libraries ◦ Test in target browsers before implementing ◦ Duplicate file structure ◦ Test “vanilla” in SharePoint first
  • 29. Some of my favorites ◦ Content Slider - http://www.awkwardgroup.com/sandbox/awkwa rd-showcase-a-jquery-plugin/ ◦ Formatted Tables - http://www.datatables.net/ ◦ Modal Window - http://www.ericmmartin.com/projects/simplemo dal/ ◦ SPServices - http://spservices.codeplex.com/ ◦ Calendar - http://arshaw.com/fullcalendar/
  • 31.
  • 32. You don‟t have to be a SharePoint Guru  It‟s Cheap  It‟s Quick  It‟s Easy  It gets the job done
  • 33. Don‟t abuse it, You‟ll pay for it later  Limited choices  There are healthier options  Adds page bloat  Can slow your performance
  • 34. Don’t drink the haterade… Mark Rackley mrackley@juniper-strategy.com www.twitter.com/mrackley www.sharepointhillbilly.com 34
  • 35.  Dfdasf adsf Please complete and turn in your Session Evaluation Form as your entry for Prizes at the end of event prize raffle. Presenter: Speaker Name Session Name: Name of Session #SPcincy2012 on Twitter www.sharepointcincy.com
  • 36. •Remember to visit the exhibit hall. •Get to know your user groups to find out about local activities and events in your area. •Make sure you stick around for the closing session and turn in your evaluation forms to be eligible for the prize raffles. #SPcincy2012 on Twitter www.sharepointcincy.com

Hinweis der Redaktion

  1. Twitter