SlideShare a Scribd company logo
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 (7)

PPTX
AJAX
Matthew Monroe
 
PDF
Beyond The Rails Way
Andrzej Krzywda
 
PDF
Parse - Backend as a Service
Ali Davut
 
PDF
Scala on-android
lifecoder
 
PPTX
004. Working with React component
Binh Quan Duc
 
KEY
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Carsonified Team
 
PPTX
Javascipt
Shreyans Gandhi
 
Beyond The Rails Way
Andrzej Krzywda
 
Parse - Backend as a Service
Ali Davut
 
Scala on-android
lifecoder
 
004. Working with React component
Binh Quan Duc
 
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Carsonified Team
 
Javascipt
Shreyans Gandhi
 

Viewers also liked (20)

PPTX
Apps for SharePoint
Melick Baranasooriya
 
PPTX
App deployment
Melick Baranasooriya
 
PPTX
Apps for SharePoint 2013
Melick Baranasooriya
 
PPTX
Share point 2013 - Javascript Object Model
Muawiyah Shannak
 
PPTX
Share point developement Introduction for students
Melick Baranasooriya
 
PPTX
Info path advanced development @ Sri Lanka SharePoint Forum
Melick Baranasooriya
 
PPTX
Conventions & Best Practices
Melick Baranasooriya
 
PPTX
Reflection
Melick Baranasooriya
 
PPTX
Lambda expressions
Melick Baranasooriya
 
PPTX
SharePoint 2013 variations feature
Melick Baranasooriya
 
PPTX
Threading
Melick Baranasooriya
 
PPTX
Oop concepts
Melick Baranasooriya
 
PPTX
Introduction to asp.net
Melick Baranasooriya
 
PDF
SharePoint Hosted Apps
David J Rosenthal
 
PDF
SharePoint App Types at a Glance
David J Rosenthal
 
PPTX
SharePoint Apps 101
Ronald Courville
 
PPTX
A Career in SharePoint
Matthew J. Bailey , MCT
 
PPTX
Get started developing apps for SharePoint 2013
Muawiyah Shannak
 
PPTX
Developing Apps for SharePoint 2013
SPC Adriatics
 
PPTX
Introduction to SharePoint 2013 Apps
Rushi Waghmare
 
Apps for SharePoint
Melick Baranasooriya
 
App deployment
Melick Baranasooriya
 
Apps for SharePoint 2013
Melick Baranasooriya
 
Share point 2013 - Javascript Object Model
Muawiyah Shannak
 
Share point developement Introduction for students
Melick Baranasooriya
 
Info path advanced development @ Sri Lanka SharePoint Forum
Melick Baranasooriya
 
Conventions & Best Practices
Melick Baranasooriya
 
Lambda expressions
Melick Baranasooriya
 
SharePoint 2013 variations feature
Melick Baranasooriya
 
Oop concepts
Melick Baranasooriya
 
Introduction to asp.net
Melick Baranasooriya
 
SharePoint Hosted Apps
David J Rosenthal
 
SharePoint App Types at a Glance
David J Rosenthal
 
SharePoint Apps 101
Ronald Courville
 
A Career in SharePoint
Matthew J. Bailey , MCT
 
Get started developing apps for SharePoint 2013
Muawiyah Shannak
 
Developing Apps for SharePoint 2013
SPC Adriatics
 
Introduction to SharePoint 2013 Apps
Rushi Waghmare
 
Ad

Similar to JSOM and java script practices (20)

PPTX
SharePoint and the User Interface with JavaScript
Regroove
 
PDF
JavaScript and jQuery for SharePoint Developers
Rob Windsor
 
PPTX
Client Object Model - SharePoint Extreme 2012
daniel plocker
 
PPTX
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
Mark Rackley
 
PPTX
Share point development 101
Becky Bertram
 
PPTX
SharePoint Saturday St. Louis - SharePoint & jQuery
Mark Rackley
 
PPTX
Spsemea j query
Mark Rackley
 
PPTX
STUG-Client Object Model SharePoint 2010
Shakir Majeed Khan
 
PPTX
Spsbe2012 sessie start to-jquery
Marijn Somers
 
PPTX
SP2010 Developer Tools
Mohamed Yehia Abdul Kader
 
PDF
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
SPTechCon
 
PPTX
TypeScript and SharePoint Framework
Bob German
 
PPTX
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
SPTechCon
 
PPTX
The SharePoint & jQuery Guide
Mark Rackley
 
PPTX
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
Kunaal Kapoor
 
PPTX
SharePoint 2013 Javascript Object Model
InnoTech
 
PPTX
Power to the People: Manipulating SharePoint with Client-Side JavaScript
PeterBrunone
 
PPTX
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
Mark Rackley
 
PPTX
SharePoint Framework 101 (SPFx)
Matthew J. Bailey , MCT
 
PPTX
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Chris O'Brien
 
SharePoint and the User Interface with JavaScript
Regroove
 
JavaScript and jQuery for SharePoint Developers
Rob Windsor
 
Client Object Model - SharePoint Extreme 2012
daniel plocker
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
Mark Rackley
 
Share point development 101
Becky Bertram
 
SharePoint Saturday St. Louis - SharePoint & jQuery
Mark Rackley
 
Spsemea j query
Mark Rackley
 
STUG-Client Object Model SharePoint 2010
Shakir Majeed Khan
 
Spsbe2012 sessie start to-jquery
Marijn Somers
 
SP2010 Developer Tools
Mohamed Yehia Abdul Kader
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
SPTechCon
 
TypeScript and SharePoint Framework
Bob German
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
SPTechCon
 
The SharePoint & jQuery Guide
Mark Rackley
 
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
Kunaal Kapoor
 
SharePoint 2013 Javascript Object Model
InnoTech
 
Power to the People: Manipulating SharePoint with Client-Side JavaScript
PeterBrunone
 
SharePoint Saturday NYC - SharePoint and jQuery, what I wish I would have kno...
Mark Rackley
 
SharePoint Framework 101 (SPFx)
Matthew J. Bailey , MCT
 
Customizing the SharePoint 2013 user interface with JavaScript - Chris OBrien
Chris O'Brien
 
Ad

More from Melick Baranasooriya (6)

PPTX
Serialization
Melick Baranasooriya
 
PPTX
Introduction To Windows Workflow Foundation 4.0
Melick Baranasooriya
 
PDF
Custom workflow in sharepoint
Melick Baranasooriya
 
PDF
Infopath controls
Melick Baranasooriya
 
PDF
Beginners SharePoint introduction
Melick Baranasooriya
 
PDF
Mvc3 crash
Melick Baranasooriya
 
Serialization
Melick Baranasooriya
 
Introduction To Windows Workflow Foundation 4.0
Melick Baranasooriya
 
Custom workflow in sharepoint
Melick Baranasooriya
 
Infopath controls
Melick Baranasooriya
 
Beginners SharePoint introduction
Melick Baranasooriya
 

Recently uploaded (20)

PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 

JSOM and java script practices