SlideShare a Scribd company logo
1 of 13
JSOM Practices in
SharePoint
Melick Baranasooriya
melick-rajee.blogspot.com
SharePoint
Environment

Need
Environment
For Connect

Dlls

SharePoint
Client

Can Use
SharePoint
Online

Dlls

SharePoint

No Dll
References

Administrator

SharePoint
Client
Runtime

JavaScript

JSOM

SharePoint
Development

Sandbox
Solutions

No Need

CSOM

Farm
Solutions

SSOM

Need
SharePoint
Environment
 Interpreted Language
 Prototype based language

JavaScript

 style of object-oriented programming
 Support Inheritance

 Dynamic Types
 Standardize as ECMAScript
x = "SomeName";
function Add() {
x = "Add";
console.log("Add");

General
Practices

}
//Functions

is this correct ?

window.Add();
//Global variables,window object
console.log( window.x );
Window
Object

Window.add = function () {
Window.x = “SomeName”

};
Self-Executing Anonymous Function
(function(mySpace,undefined ) {

Own
Namespace

}( window.mySpace = window.mySpace || {}));
 Check the global space for mySpace and assign a new one if not available
 Leave the undefined as undefined.
(function(mySpace,undefined ) {
//Private
var x = 1;
//Public

Properties

mySpace.y = "2";

}( window.mySpace = window.mySpace || {}));
Console.log(mySpace.y)
Console.log(mySpace.x) – Not accessible
(function(mySpace,undefined ) {
//Public
mySpace.add = function() {

console.log("Add")
};

Methods
//Private
function addItem(

) {

console.log("AddItem")
}

}( window.mySpace = window.mySpace || {}));
mySpace.Class1 = function () { };
mySpace.Class1.prototype = {
methodOne: function () {

return "methodOne";
},

Classes and
Objects

methodTwo: function (para) {
console.log(para);
}
};
var a = new Class1();

a.methodOne();
 Use Js files available in Web Server
Extensions15TEMPLATELAYOUTS

JSOM
JavaScript
Object Model
 SharePoint Hosted
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function
() {
// Do
});

 Provider Hosted

JSOM

<script type="text/javascript"
src="/_layouts/15/MicrosoftAjax.js"></script>

<script type="text/javascript"
src="/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript"
src="/_layouts/15/sp.js"></script>
Single
Reference
Pattern
https://srj.code
plex.com/
?
Thank You

More Related Content

What's hot

Parse - Backend as a Service
Parse - Backend as a ServiceParse - Backend as a Service
Parse - Backend as a ServiceAli Davut
 
Scala on-android
Scala on-androidScala on-android
Scala on-androidlifecoder
 
004. Working with React component
004. Working with React component004. Working with React component
004. Working with React componentBinh Quan Duc
 
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web AppMolly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web AppCarsonified Team
 

What's hot (7)

AJAX
AJAXAJAX
AJAX
 
Beyond The Rails Way
Beyond The Rails WayBeyond The Rails Way
Beyond The Rails Way
 
Parse - Backend as a Service
Parse - Backend as a ServiceParse - Backend as a Service
Parse - Backend as a Service
 
Scala on-android
Scala on-androidScala on-android
Scala on-android
 
004. Working with React component
004. Working with React component004. Working with React component
004. Working with React component
 
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web AppMolly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
 
Javascipt
JavasciptJavascipt
Javascipt
 

Viewers also liked

Share point 2013 - Javascript Object Model
Share point 2013 - Javascript Object ModelShare point 2013 - Javascript Object Model
Share point 2013 - Javascript Object ModelMuawiyah Shannak
 
Share point developement Introduction for students
Share point developement Introduction for studentsShare point developement Introduction for students
Share point developement Introduction for studentsMelick Baranasooriya
 
Info path advanced development @ Sri Lanka SharePoint Forum
Info path advanced development @ Sri Lanka SharePoint ForumInfo path advanced development @ Sri Lanka SharePoint Forum
Info path advanced development @ Sri Lanka SharePoint ForumMelick Baranasooriya
 
SharePoint 2013 variations feature
SharePoint 2013 variations featureSharePoint 2013 variations feature
SharePoint 2013 variations featureMelick Baranasooriya
 
SharePoint App Types at a Glance
SharePoint App Types at a GlanceSharePoint App Types at a Glance
SharePoint App Types at a GlanceDavid J Rosenthal
 
Get started developing apps for SharePoint 2013
Get started developing apps for SharePoint 2013Get started developing apps for SharePoint 2013
Get started developing apps for SharePoint 2013Muawiyah Shannak
 
Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013SPC Adriatics
 
Introduction to SharePoint 2013 Apps
Introduction to SharePoint 2013 AppsIntroduction to SharePoint 2013 Apps
Introduction to SharePoint 2013 AppsRushi Waghmare
 

Viewers also liked (20)

Apps for SharePoint
Apps for SharePointApps for SharePoint
Apps for SharePoint
 
App deployment
App deploymentApp deployment
App deployment
 
Apps for SharePoint 2013
Apps for SharePoint 2013Apps for SharePoint 2013
Apps for SharePoint 2013
 
Share point 2013 - Javascript Object Model
Share point 2013 - Javascript Object ModelShare point 2013 - Javascript Object Model
Share point 2013 - Javascript Object Model
 
Share point developement Introduction for students
Share point developement Introduction for studentsShare point developement Introduction for students
Share point developement Introduction for students
 
Info path advanced development @ Sri Lanka SharePoint Forum
Info path advanced development @ Sri Lanka SharePoint ForumInfo path advanced development @ Sri Lanka SharePoint Forum
Info path advanced development @ Sri Lanka SharePoint Forum
 
Conventions & Best Practices
Conventions & Best PracticesConventions & Best Practices
Conventions & Best Practices
 
Reflection
ReflectionReflection
Reflection
 
Lambda expressions
Lambda expressionsLambda expressions
Lambda expressions
 
SharePoint 2013 variations feature
SharePoint 2013 variations featureSharePoint 2013 variations feature
SharePoint 2013 variations feature
 
Threading
ThreadingThreading
Threading
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
SharePoint Hosted Apps
SharePoint Hosted AppsSharePoint Hosted Apps
SharePoint Hosted Apps
 
SharePoint App Types at a Glance
SharePoint App Types at a GlanceSharePoint App Types at a Glance
SharePoint App Types at a Glance
 
SharePoint Apps 101
SharePoint Apps 101SharePoint Apps 101
SharePoint Apps 101
 
A Career in SharePoint
A Career in SharePointA Career in SharePoint
A Career in SharePoint
 
Get started developing apps for SharePoint 2013
Get started developing apps for SharePoint 2013Get started developing apps for SharePoint 2013
Get started developing apps for SharePoint 2013
 
Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013
 
Introduction to SharePoint 2013 Apps
Introduction to SharePoint 2013 AppsIntroduction to SharePoint 2013 Apps
Introduction to SharePoint 2013 Apps
 

Similar to JSOM Practices in SharePoint

Learn how to develop for Android, beyond the Hello World android app - Cape T...
Learn how to develop for Android, beyond the Hello World android app - Cape T...Learn how to develop for Android, beyond the Hello World android app - Cape T...
Learn how to develop for Android, beyond the Hello World android app - Cape T...Joseph Kandi
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersRob Windsor
 
Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script PatternsAllan Huang
 
Bringing classical OOP into JavaScript
Bringing classical OOP into JavaScriptBringing classical OOP into JavaScript
Bringing classical OOP into JavaScriptDmitry Sheiko
 
SharePoint 2013 Javascript Object Model
SharePoint 2013 Javascript Object ModelSharePoint 2013 Javascript Object Model
SharePoint 2013 Javascript Object ModelInnoTech
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015jbandi
 
Firefox extension Development
Firefox extension DevelopmentFirefox extension Development
Firefox extension DevelopmentAbhinav Chittora
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 
Javascript coding-and-design-patterns
Javascript coding-and-design-patternsJavascript coding-and-design-patterns
Javascript coding-and-design-patternsHernan Mammana
 
Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010Binh Nguyen
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Domkaven yan
 
JavaScript Misunderstood
JavaScript MisunderstoodJavaScript Misunderstood
JavaScript MisunderstoodBhavya Siddappa
 

Similar to JSOM Practices in SharePoint (20)

Introduction to Advanced Javascript
Introduction to Advanced JavascriptIntroduction to Advanced Javascript
Introduction to Advanced Javascript
 
Learn how to develop for Android, beyond the Hello World android app - Cape T...
Learn how to develop for Android, beyond the Hello World android app - Cape T...Learn how to develop for Android, beyond the Hello World android app - Cape T...
Learn how to develop for Android, beyond the Hello World android app - Cape T...
 
Automation patterns on practice
Automation patterns on practiceAutomation patterns on practice
Automation patterns on practice
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script Patterns
 
Bringing classical OOP into JavaScript
Bringing classical OOP into JavaScriptBringing classical OOP into JavaScript
Bringing classical OOP into JavaScript
 
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core
 
SharePoint 2013 Javascript Object Model
SharePoint 2013 Javascript Object ModelSharePoint 2013 Javascript Object Model
SharePoint 2013 Javascript Object Model
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
 
Open event presentation.3 2
Open event presentation.3 2Open event presentation.3 2
Open event presentation.3 2
 
Firefox extension Development
Firefox extension DevelopmentFirefox extension Development
Firefox extension Development
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
 
Javascript coding-and-design-patterns
Javascript coding-and-design-patternsJavascript coding-and-design-patterns
Javascript coding-and-design-patterns
 
Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
Building Custom PHP Extensions
Building Custom PHP ExtensionsBuilding Custom PHP Extensions
Building Custom PHP Extensions
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
 
JavaScript Misunderstood
JavaScript MisunderstoodJavaScript Misunderstood
JavaScript Misunderstood
 

More from Melick Baranasooriya

More from Melick Baranasooriya (6)

Serialization
SerializationSerialization
Serialization
 
Introduction To Windows Workflow Foundation 4.0
Introduction To Windows Workflow Foundation 4.0Introduction To Windows Workflow Foundation 4.0
Introduction To Windows Workflow Foundation 4.0
 
Custom workflow in sharepoint
Custom workflow in sharepointCustom workflow in sharepoint
Custom workflow in sharepoint
 
Infopath controls
Infopath controlsInfopath controls
Infopath controls
 
Beginners SharePoint introduction
Beginners SharePoint introductionBeginners SharePoint introduction
Beginners SharePoint introduction
 
Mvc3 crash
Mvc3 crashMvc3 crash
Mvc3 crash
 

Recently uploaded

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

JSOM Practices in SharePoint