SlideShare a Scribd company logo
JavaScript and jQuery,
the Atlassian way
Quick Intro
• Not a Toy language
• Small but powerful
• Has design flaws
• Hits the high notes
Key Concepts
• Load and Go
• Loose Typing
• Lambda
• Prototypal Inheritance
• Single Threaded
Values
• Numbers
– 64-bit floating point, NaN, Infinity

• Strings
– UCS-2 (not quite UTF-16), Immutable

• Booleans
• Objects
– Hashes

• null
• undefined
Resources
http://api.jquery.com/
https://developer.mozilla.org/en/JavaScripthttp://document
cloud.github.com/backbone/
http://documentcloud.github.com/underscore/
// Collections!
var $collection = jQuery("a[rel=userprofile]");
// $collection is a jQuery collection.
// It can have 0 or more elements.
$collection.addClass("foo");
// API functions apply to all elements in the
// collection.
var p = document.getElementById("myUserProfile");
var $collection2 = jQuery(p);
// $collection2 is a jQuery collection.
// It has 1 element.
var $hi = jQuery("<p>Hello, world.</p>");
// $hi is also a jQuery collection,
// containing 1 element.
console.log($collection.length);
// The number of elements in $collection.
console.log($collection[0]);
// The first DOM element in $collection.
//methods on the same collection
$collection.attr("hreflang", "fr");
// Sets the "hreflang" attribute on *all*
// elements in $collection.
$collection.attr("href");
// Gets the "href" attribute of the
// *first* element in $collection.
//script execution and DOM Ready
console.log(
jQuery("input[type=checkbox]").length
); // => 0
// The page has only loaded enough
// elements to get to this <script>.
jQuery(function() {
// This function is called when the page
// has fully loaded.
console.log(
jQuery("input[type=checkbox]").length
); // => 6
});
//events
function handleEvent(event) {
console.log(this);
// The element clicked,
// not a jQuery collection
event.preventDefault();
// Prevent the default action of this
// event.
}
$collection.bind("click", handleEvent);
// handleEvent is called when any element
// in $collection is clicked.
$collection.unbind("click", handleEvent);
//when I say stop I mean…
$collection.bind("keydown",
function(event) {
event.stopPropagation();
event.stopImmediatePropagation();
return false;
// Avoid these.
// This breaks the key rule that
// event handlers should be agnostic
// of other event handlers.
});
//custom events
$collection.bind("myCustomEvent",
function(event) {
// custom event handler
});
$collection.trigger("myCustomEvent");
// Dispatch an event of type
// "myCustomEvent"
//bind to arbitrary objects
MyApp.ISSUES = {};
jQuery(MyApp.ISSUES).bind("add_issue",
function(newIssue) {
// Handle adding new issues
});
// jQuery(MyApp.ISSUES) is a jQuery
// collection containing the JavaScript
// object MyApp.ISSUES.
var newIssue = new Issue(newIssueId);
jQuery(MyApp.ISSUES).trigger("add_issue",
[newIssue]);
// The second argument to trigger() is an
// array of arguments to supply listeners.
//ajax
var xhr = jQuery.ajax("/users", {
type: "PUT", // HTTP method
contentType: "application/json", // request header
data: '{"name":"Fred Jones","role":"JavaScript Developer"}',
dataType: "json" // Accept: application/json
});
xhr.complete(function(xhr) {
console.log(xhr.status); // 200
console.log(xhr.data); // JSON-decoded response
console.log(xhr.responseText); // JSON string
});
xhr.success(function(data) {
console.log(data); // JSON-decoded response
});
xhr.error(function(xhr, errType) {
console.log(errType); // "error" (4xx or 5xx)
// Other possible values: "abort", "timeout", "parsererror"
});
//store data against DOM nodes
// Set data:
jQuery.data(obj, "key", "value");
// Get data:
jQuery.data(obj, "key"); // => "value"
//
//
//
//

obj can be any DOM element or
JavaScript object.
The key can be any string.
The value can be any type.

More Related Content

What's hot (20)

Découplez votre appli en micro-APIs
Découplez votre appli en micro-APIsDécouplez votre appli en micro-APIs
Découplez votre appli en micro-APIs
Nicolas Blanco
 
So long, jQuery, and thanks for all the fish!
So long, jQuery, and thanks for all the fish!So long, jQuery, and thanks for all the fish!
So long, jQuery, and thanks for all the fish!
Matt Turnure
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
Remy Sharp
 
JQuery
JQueryJQuery
JQuery
Jussi Pohjolainen
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
Jussi Pohjolainen
 
AngularJS Routing
AngularJS RoutingAngularJS Routing
AngularJS Routing
Eyal Vardi
 
Week 4 - jQuery + Ajax
Week 4 - jQuery + AjaxWeek 4 - jQuery + Ajax
Week 4 - jQuery + Ajax
baygross
 
jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Events
dmethvin
 
jQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, Ajax
Constantin Titarenko
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
elliando dias
 
php Slideshare
php Slidesharephp Slideshare
php Slideshare
Jason Liao
 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the web
Remy Sharp
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
Eyal Vardi
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
Luke Summerfield
 
AngularJS Services
AngularJS ServicesAngularJS Services
AngularJS Services
Eyal Vardi
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.js
Jarod Ferguson
 
Dart and AngularDart
Dart and AngularDartDart and AngularDart
Dart and AngularDart
Loc Nguyen
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
NexThoughts Technologies
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
 
Découplez votre appli en micro-APIs
Découplez votre appli en micro-APIsDécouplez votre appli en micro-APIs
Découplez votre appli en micro-APIs
Nicolas Blanco
 
So long, jQuery, and thanks for all the fish!
So long, jQuery, and thanks for all the fish!So long, jQuery, and thanks for all the fish!
So long, jQuery, and thanks for all the fish!
Matt Turnure
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
Remy Sharp
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
Jussi Pohjolainen
 
AngularJS Routing
AngularJS RoutingAngularJS Routing
AngularJS Routing
Eyal Vardi
 
Week 4 - jQuery + Ajax
Week 4 - jQuery + AjaxWeek 4 - jQuery + Ajax
Week 4 - jQuery + Ajax
baygross
 
jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Events
dmethvin
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
elliando dias
 
php Slideshare
php Slidesharephp Slideshare
php Slideshare
Jason Liao
 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the web
Remy Sharp
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
Eyal Vardi
 
Javascript Frameworks for Joomla
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for Joomla
Luke Summerfield
 
AngularJS Services
AngularJS ServicesAngularJS Services
AngularJS Services
Eyal Vardi
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.js
Jarod Ferguson
 
Dart and AngularDart
Dart and AngularDartDart and AngularDart
Dart and AngularDart
Loc Nguyen
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
 

Viewers also liked (9)

Evented Javascript
Evented JavascriptEvented Javascript
Evented Javascript
waw325
 
Młodzi 2011 - Berlin 2012
Młodzi 2011 - Berlin 2012Młodzi 2011 - Berlin 2012
Młodzi 2011 - Berlin 2012
Piotr Arak
 
Summit 2013 - Integrations at Atlassian
Summit 2013 - Integrations at AtlassianSummit 2013 - Integrations at Atlassian
Summit 2013 - Integrations at Atlassian
waw325
 
HAMMERTIME EXAM REVIEW
HAMMERTIME EXAM REVIEWHAMMERTIME EXAM REVIEW
HAMMERTIME EXAM REVIEW
hammertime11155
 
Młodzi 2011 - Mielec - 21 września 2012
Młodzi 2011 - Mielec - 21 września 2012Młodzi 2011 - Mielec - 21 września 2012
Młodzi 2011 - Mielec - 21 września 2012
Piotr Arak
 
Jak naprawić klin podatkowy - Polityka Insight
Jak naprawić klin podatkowy - Polityka InsightJak naprawić klin podatkowy - Polityka Insight
Jak naprawić klin podatkowy - Polityka Insight
Piotr Arak
 
Summit 2012 - How Atlassian Uses Confluence
Summit 2012 - How Atlassian Uses ConfluenceSummit 2012 - How Atlassian Uses Confluence
Summit 2012 - How Atlassian Uses Confluence
waw325
 
Statistical supplement june 2011 final[1]
Statistical supplement june 2011   final[1]Statistical supplement june 2011   final[1]
Statistical supplement june 2011 final[1]
Sammit Shukla
 
Export Marketing services in India
Export Marketing services in IndiaExport Marketing services in India
Export Marketing services in India
Globexo Marketing
 
Evented Javascript
Evented JavascriptEvented Javascript
Evented Javascript
waw325
 
Młodzi 2011 - Berlin 2012
Młodzi 2011 - Berlin 2012Młodzi 2011 - Berlin 2012
Młodzi 2011 - Berlin 2012
Piotr Arak
 
Summit 2013 - Integrations at Atlassian
Summit 2013 - Integrations at AtlassianSummit 2013 - Integrations at Atlassian
Summit 2013 - Integrations at Atlassian
waw325
 
Młodzi 2011 - Mielec - 21 września 2012
Młodzi 2011 - Mielec - 21 września 2012Młodzi 2011 - Mielec - 21 września 2012
Młodzi 2011 - Mielec - 21 września 2012
Piotr Arak
 
Jak naprawić klin podatkowy - Polityka Insight
Jak naprawić klin podatkowy - Polityka InsightJak naprawić klin podatkowy - Polityka Insight
Jak naprawić klin podatkowy - Polityka Insight
Piotr Arak
 
Summit 2012 - How Atlassian Uses Confluence
Summit 2012 - How Atlassian Uses ConfluenceSummit 2012 - How Atlassian Uses Confluence
Summit 2012 - How Atlassian Uses Confluence
waw325
 
Statistical supplement june 2011 final[1]
Statistical supplement june 2011   final[1]Statistical supplement june 2011   final[1]
Statistical supplement june 2011 final[1]
Sammit Shukla
 
Export Marketing services in India
Export Marketing services in IndiaExport Marketing services in India
Export Marketing services in India
Globexo Marketing
 

Similar to Javascript and jQuery intro (20)

06 jQuery #burningkeyboards
06 jQuery  #burningkeyboards06 jQuery  #burningkeyboards
06 jQuery #burningkeyboards
Denis Ristic
 
jQuery
jQueryjQuery
jQuery
Ivano Malavolta
 
fuser interface-development-using-jquery
fuser interface-development-using-jqueryfuser interface-development-using-jquery
fuser interface-development-using-jquery
Kostas Mavridis
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
Eduardo Shiota Yasuda
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
colinbdclark
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScript
Andrew Dupont
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
Thinqloud
 
DrupalCon jQuery
DrupalCon jQueryDrupalCon jQuery
DrupalCon jQuery
Nathan Smith
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
Jonas De Smet
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
Bastian Feder
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developers
Dream Production AG
 
Javascript essential-pattern
Javascript essential-patternJavascript essential-pattern
Javascript essential-pattern
偉格 高
 
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
colinbdclark
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
Remy Sharp
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
Mohammad Usman
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
Knoldus Inc.
 
"this" in JavaScript
"this" in JavaScript"this" in JavaScript
"this" in JavaScript
Martha Schumann
 
JQuery In Drupal
JQuery In DrupalJQuery In Drupal
JQuery In Drupal
katbailey
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
Alexander Varwijk
 
06 jQuery #burningkeyboards
06 jQuery  #burningkeyboards06 jQuery  #burningkeyboards
06 jQuery #burningkeyboards
Denis Ristic
 
fuser interface-development-using-jquery
fuser interface-development-using-jqueryfuser interface-development-using-jquery
fuser interface-development-using-jquery
Kostas Mavridis
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
colinbdclark
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScript
Andrew Dupont
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
Thinqloud
 
jQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
Jonas De Smet
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developers
Dream Production AG
 
Javascript essential-pattern
Javascript essential-patternJavascript essential-pattern
Javascript essential-pattern
偉格 高
 
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
colinbdclark
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
Remy Sharp
 
Jquery- One slide completing all JQuery
Jquery- One slide completing all JQueryJquery- One slide completing all JQuery
Jquery- One slide completing all JQuery
Knoldus Inc.
 
JQuery In Drupal
JQuery In DrupalJQuery In Drupal
JQuery In Drupal
katbailey
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
Alexander Varwijk
 

Recently uploaded (20)

UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
 
Create Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent BuilderCreate Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent Builder
DianaGray10
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Nikki Chapple
 
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AI Emotional Actors:  “When Machines Learn to Feel and Perform"AI Emotional Actors:  “When Machines Learn to Feel and Perform"
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AkashKumar809858
 
Introducing Ensemble Cloudlet vRouter
Introducing Ensemble  Cloudlet vRouterIntroducing Ensemble  Cloudlet vRouter
Introducing Ensemble Cloudlet vRouter
Adtran
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
Contributing to WordPress With & Without Code.pptx
Contributing to WordPress With & Without Code.pptxContributing to WordPress With & Without Code.pptx
Contributing to WordPress With & Without Code.pptx
Patrick Lumumba
 
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Aaryan Kansari
 
What is DePIN? The Hottest Trend in Web3 Right Now!
What is DePIN? The Hottest Trend in Web3 Right Now!What is DePIN? The Hottest Trend in Web3 Right Now!
What is DePIN? The Hottest Trend in Web3 Right Now!
cryptouniversityoffi
 
AI Trends - Mary Meeker
AI Trends - Mary MeekerAI Trends - Mary Meeker
AI Trends - Mary Meeker
Razin Mustafiz
 
Splunk Leadership Forum Wien - 20.05.2025
Splunk Leadership Forum Wien - 20.05.2025Splunk Leadership Forum Wien - 20.05.2025
Splunk Leadership Forum Wien - 20.05.2025
Splunk
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Grannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI ExperiencesGrannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI Experiences
Lauren Parr
 
Building Agents with LangGraph & Gemini
Building Agents with LangGraph &  GeminiBuilding Agents with LangGraph &  Gemini
Building Agents with LangGraph & Gemini
HusseinMalikMammadli
 
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
 
European Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility TestingEuropean Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility Testing
Julia Undeutsch
 
cloudgenesis cloud workshop , gdg on campus mita
cloudgenesis cloud workshop , gdg on campus mitacloudgenesis cloud workshop , gdg on campus mita
cloudgenesis cloud workshop , gdg on campus mita
siyaldhande02
 
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath InsightsUiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPath Community Berlin: Studio Tips & Tricks and UiPath Insights
UiPathCommunity
 
Create Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent BuilderCreate Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent Builder
DianaGray10
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Nikki Chapple
 
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AI Emotional Actors:  “When Machines Learn to Feel and Perform"AI Emotional Actors:  “When Machines Learn to Feel and Perform"
AI Emotional Actors: “When Machines Learn to Feel and Perform"
AkashKumar809858
 
Introducing Ensemble Cloudlet vRouter
Introducing Ensemble  Cloudlet vRouterIntroducing Ensemble  Cloudlet vRouter
Introducing Ensemble Cloudlet vRouter
Adtran
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
Contributing to WordPress With & Without Code.pptx
Contributing to WordPress With & Without Code.pptxContributing to WordPress With & Without Code.pptx
Contributing to WordPress With & Without Code.pptx
Patrick Lumumba
 
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Aaryan Kansari
 
What is DePIN? The Hottest Trend in Web3 Right Now!
What is DePIN? The Hottest Trend in Web3 Right Now!What is DePIN? The Hottest Trend in Web3 Right Now!
What is DePIN? The Hottest Trend in Web3 Right Now!
cryptouniversityoffi
 
AI Trends - Mary Meeker
AI Trends - Mary MeekerAI Trends - Mary Meeker
AI Trends - Mary Meeker
Razin Mustafiz
 
Splunk Leadership Forum Wien - 20.05.2025
Splunk Leadership Forum Wien - 20.05.2025Splunk Leadership Forum Wien - 20.05.2025
Splunk Leadership Forum Wien - 20.05.2025
Splunk
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Grannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI ExperiencesGrannie’s Journey to Using Healthcare AI Experiences
Grannie’s Journey to Using Healthcare AI Experiences
Lauren Parr
 
Building Agents with LangGraph & Gemini
Building Agents with LangGraph &  GeminiBuilding Agents with LangGraph &  Gemini
Building Agents with LangGraph & Gemini
HusseinMalikMammadli
 
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
 
European Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility TestingEuropean Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility Testing
Julia Undeutsch
 
cloudgenesis cloud workshop , gdg on campus mita
cloudgenesis cloud workshop , gdg on campus mitacloudgenesis cloud workshop , gdg on campus mita
cloudgenesis cloud workshop , gdg on campus mita
siyaldhande02
 

Javascript and jQuery intro

  • 2. Quick Intro • Not a Toy language • Small but powerful • Has design flaws • Hits the high notes
  • 3. Key Concepts • Load and Go • Loose Typing • Lambda • Prototypal Inheritance • Single Threaded
  • 4. Values • Numbers – 64-bit floating point, NaN, Infinity • Strings – UCS-2 (not quite UTF-16), Immutable • Booleans • Objects – Hashes • null • undefined
  • 6. // Collections! var $collection = jQuery("a[rel=userprofile]"); // $collection is a jQuery collection. // It can have 0 or more elements. $collection.addClass("foo"); // API functions apply to all elements in the // collection. var p = document.getElementById("myUserProfile"); var $collection2 = jQuery(p); // $collection2 is a jQuery collection. // It has 1 element.
  • 7. var $hi = jQuery("<p>Hello, world.</p>"); // $hi is also a jQuery collection, // containing 1 element. console.log($collection.length); // The number of elements in $collection. console.log($collection[0]); // The first DOM element in $collection.
  • 8. //methods on the same collection $collection.attr("hreflang", "fr"); // Sets the "hreflang" attribute on *all* // elements in $collection. $collection.attr("href"); // Gets the "href" attribute of the // *first* element in $collection.
  • 9. //script execution and DOM Ready console.log( jQuery("input[type=checkbox]").length ); // => 0 // The page has only loaded enough // elements to get to this <script>. jQuery(function() { // This function is called when the page // has fully loaded. console.log( jQuery("input[type=checkbox]").length ); // => 6 });
  • 10. //events function handleEvent(event) { console.log(this); // The element clicked, // not a jQuery collection event.preventDefault(); // Prevent the default action of this // event. } $collection.bind("click", handleEvent); // handleEvent is called when any element // in $collection is clicked. $collection.unbind("click", handleEvent);
  • 11. //when I say stop I mean… $collection.bind("keydown", function(event) { event.stopPropagation(); event.stopImmediatePropagation(); return false; // Avoid these. // This breaks the key rule that // event handlers should be agnostic // of other event handlers. });
  • 12. //custom events $collection.bind("myCustomEvent", function(event) { // custom event handler }); $collection.trigger("myCustomEvent"); // Dispatch an event of type // "myCustomEvent"
  • 13. //bind to arbitrary objects MyApp.ISSUES = {}; jQuery(MyApp.ISSUES).bind("add_issue", function(newIssue) { // Handle adding new issues }); // jQuery(MyApp.ISSUES) is a jQuery // collection containing the JavaScript // object MyApp.ISSUES. var newIssue = new Issue(newIssueId); jQuery(MyApp.ISSUES).trigger("add_issue", [newIssue]); // The second argument to trigger() is an // array of arguments to supply listeners.
  • 14. //ajax var xhr = jQuery.ajax("/users", { type: "PUT", // HTTP method contentType: "application/json", // request header data: '{"name":"Fred Jones","role":"JavaScript Developer"}', dataType: "json" // Accept: application/json }); xhr.complete(function(xhr) { console.log(xhr.status); // 200 console.log(xhr.data); // JSON-decoded response console.log(xhr.responseText); // JSON string }); xhr.success(function(data) { console.log(data); // JSON-decoded response }); xhr.error(function(xhr, errType) { console.log(errType); // "error" (4xx or 5xx) // Other possible values: "abort", "timeout", "parsererror" });
  • 15. //store data against DOM nodes // Set data: jQuery.data(obj, "key", "value"); // Get data: jQuery.data(obj, "key"); // => "value" // // // // obj can be any DOM element or JavaScript object. The key can be any string. The value can be any type.