SlideShare a Scribd company logo
A brief view at client web



                      Markiyan Matsekh
                             Web developer
No, we won’t
HTTP   HTML

CSS     JS
Transport    Content


Appearance   Behavior
Http (HyperText Transfer Protocol) –
is a deal between client and server on
how to deliver data
Http
- Request/Response model
- Stateless
- Operates with text
How to transfer large binary files
       through protocol
  which operates with text?
How to maintain state
in stateless protocol?
How to get updates from server
when all you can do is ask for?
Http methods
-   Get
-   Post
-   Put
-   Delete
-   (few less used)
Time for a small demo
What about security?
Https
- Agree on PreMasterSecret
- Encrypt traffic with it
- Send data safely
Html (HyperText Markup Language) –
is a tool for describing contents with
pre-defined limited set of words
Is a set of rules,
   by which browser
reads this description
<form name="input" action=“your_url"
method="get">
     Text: <input type=“text" name=“text” />
     Radio: <input type="checkbox"
     name=“radio"/>
     <input type="submit" value="Submit" />
</form>




                        Here comes Http
The number of html elements is growing…




Because what really matters nowadays…
Html5 is just a logical step in evolution of web

             ordo ab chao
               After chaos comes order
Css (Cascading Style Sheets) –
is a way of describing how your contents
should look
Css rules priorities
Css rules priorities
        -   #id == 3
        -   .classname == 2
        -   [attr] == 2
        -   el == 1


  Sum = … -> order -> priority = …
JavaScript –
is a powerful programming language,
embedded into the browsers,
letting us control the behavior of contents
Unobtrusive JavaScript
10 years ago
<body bgcolor=“#000”>
BAD! Now we move styles into separate files
body {
    background-color: #000;
}
Same with javascript. We put him into separate file.
Bad, mixing JavaScript with HTML
<button type="button“
  onclick=“document.getElementById(„photo').style.color='red';“>
Click Me
</button>
<div id=“photo”>I am photo</div>
Unobtrusive JavaScript
<button type="button" id="testButton">
Click Me                                 <-clean HTML
</button>

<script type="text/javascript">
window.onload = init;

function init() {
  document.getElementById('testButton').onclick =
makeItRed;
}
function makeItRed() {
  document.getElementById(„photo').style.color = 'red';
};
</script>
HTTP   HTML

CSS     JS
Transport    Content


Appearance   Behavior
Separation of concerns
Events
• World Wide Web – it’s events that make it all
  happen

1 Set up the user interface.
2 Wait for something interesting to happen.
3 React accordingly.
4 Repeat.
Netscape Event Model (march 1996)
                   DOM Level 0 Event Model
•   Hanlder function is assigned to attribtues on html element (onclick)

    <button id=“button1” value=“I‟m button”
         onclick=“alert(„I‟am clicked‟)” />

    <script type="text/javascript">
      $(function() {
        $(„#button1‟)[0].onfocus = function(event) {
            console.log(„Focused!‟);
        }
      });
    </script>
Across the browsers?
1. IE doesn’t invoke function with ‘event’
   $(„#button1‟)[0].onfocus = function(event) {
      if (!event) event = window.event;
   }

2. IE has event.target instead of event.srcElement:
   var target = (event.target)
       ? event.target : event.srcElement;



$(„#button1‟)[0].onfocus = function(event) {
  if (!event) event = window.event;
  var target = (event.target)
      ? event.target : event.srcElement;
}
Event bubbling
Event bubbling
document.onclick = function(event) {
  alert(event.target.tagName);
}

Events bubbling (propagation)
Browsers:     event.stopPropagation();
IE:       event.cancelBubble = true;
These don’t bubble: focus, blur; change, submit

Events default actions
<form name=“myform” onsubmit=“return false;”></form|>
<a href=“http://www.mysite.com” onclick=“return false;”></a>
Browsers:      event.preventDefault();
IE:       event.returnValue = false;

event.currentTarget – doesn’t work on IE
The DOM Level 2 Event Model (november2000)
function doFirstThing() {
}
function doSecondThing() {
}

addEventListener(eventType, listener, useCapture)

someElement.addEventListener(„click‟, doFirstThing, false);
someElement.addEventListener(„click‟, doSecondThing, false);
// (порядок виконання не гарантується)

IE: attachEvent(eventName, handler); // window.event :(
someElement.attachEvent(„onclick‟, doFirstThing);
someElement.attachEvent(„onclick‟, doSecondThing);
jQuery
What is jQuery?
$(), jQuery() – is function, just another piece of js code. But more
pleasant one

var jQuery = function(selector, context) {
  return new jQuery.fn.init(selector, context);
}
jQuery.fn.init - returns wrapped set
What does jQuery do?
$(selector).action()
<div>Some text</div>
<div class=“winter”>Winter text</div>

<script type=“text/javascript”>
$('div.winter').hide();
// jQuery chaining
$('div.winter').hide().show();

$('div.winter').hide().show().removeClass('winter').addClass('spring');
// same as:
var myDiv = $('div.winter');
myDiv.hide();
myDiv.show();
myDiv.removeClass('winter');
myDiv.addClass('spring');
</script>
CSS, or jQuery selectors
p a { color: green; }
$(“p a”).css(„color‟, „green‟);
$("p:even");
$("tr:nth-child(1)");
$("body > div");
$("a[href$=pdf]");
$("body > div:has(a)");
The jQuery Event Model

$(„img‟).bind(„click‟, function(event) {
    alert(„Image clicked ‟ + $(this).attr(„alt‟));
});

•   Unified way of adding event handlers
•   Easy to add many handlers at once
•   Standard names (click, focus);
•   ‘event’ is always present and in the same form
•   Unified way of canceling and preventing default actions
    (event.preventDefault()) (event.cancelBubble())
Ajax (Asynchronous JavaScript and Xml) –
is a chance to reload the content
without reloading the whole page
Usual Ajax workflow
1. Simple HTTP Get through click
2. Page loads javascript logic for ajax
3. Certain actions lead user to async ajax requests
4. Browser sends request to server without reloading page
5. Server examines that the request is async
6. Server s sends back piece of html or json
7. Client gets response and applies it to page
Ajax lets us use more HTTP then
         <form> element
Don’t forget!

•   Javascript is tricky
•   Javascript is single-threaded
•   Events run it all
•   Use Ajax wisely
•   Use Cookies wisely
And now time for
another demo
Client Web

More Related Content

What's hot

Special Events: Beyond Custom Events
Special Events: Beyond Custom EventsSpecial Events: Beyond Custom Events
Special Events: Beyond Custom EventsBrandon Aaron
 
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiJ Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
Muhammad Ehtisham Siddiqui
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
Mevin Mohan
 
jQuery Mobile with HTML5
jQuery Mobile with HTML5jQuery Mobile with HTML5
jQuery Mobile with HTML5
madhurpgarg
 
jQuery Best Practice
jQuery Best Practice jQuery Best Practice
jQuery Best Practice
chandrashekher786
 
Knockoutjs
KnockoutjsKnockoutjs
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Nivedhitha Venugopal
 
Knockout.js presentation
Knockout.js presentationKnockout.js presentation
Knockout.js presentationScott Messinger
 
Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap
Rakesh Jha
 
jQuery Mobile: Progressive Enhancement with HTML5
jQuery Mobile: Progressive Enhancement with HTML5jQuery Mobile: Progressive Enhancement with HTML5
jQuery Mobile: Progressive Enhancement with HTML5
Todd Anderson
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps OfflinePedro Morais
 
Js events
Js eventsJs events
Js events
gvbmail
 
Meet VueJs
Meet VueJsMeet VueJs
Meet VueJs
Mathieu Breton
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and ModernizrJussi Pohjolainen
 
Lec 5
Lec 5Lec 5

What's hot (20)

Special Events: Beyond Custom Events
Special Events: Beyond Custom EventsSpecial Events: Beyond Custom Events
Special Events: Beyond Custom Events
 
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham SiddiquiJ Query (Complete Course) by Muhammad Ehtisham Siddiqui
J Query (Complete Course) by Muhammad Ehtisham Siddiqui
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
jQuery Mobile with HTML5
jQuery Mobile with HTML5jQuery Mobile with HTML5
jQuery Mobile with HTML5
 
jQuery Best Practice
jQuery Best Practice jQuery Best Practice
jQuery Best Practice
 
Knockoutjs
KnockoutjsKnockoutjs
Knockoutjs
 
JavaScript and BOM events
JavaScript and BOM eventsJavaScript and BOM events
JavaScript and BOM events
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Knockout.js
Knockout.jsKnockout.js
Knockout.js
 
Knockout.js presentation
Knockout.js presentationKnockout.js presentation
Knockout.js presentation
 
Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
jQuery Mobile: Progressive Enhancement with HTML5
jQuery Mobile: Progressive Enhancement with HTML5jQuery Mobile: Progressive Enhancement with HTML5
jQuery Mobile: Progressive Enhancement with HTML5
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
 
Js events
Js eventsJs events
Js events
 
Meet VueJs
Meet VueJsMeet VueJs
Meet VueJs
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
 
JQuery
JQueryJQuery
JQuery
 
Lec 5
Lec 5Lec 5
Lec 5
 

Viewers also liked

A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)
Gustaf Nilsson Kotte
 
Web server
Web serverWeb server
Web server
Ankit Raj
 
What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)
Amit Nirala
 
CLIENT SERVER IN OS.ppt
CLIENT SERVER IN OS.pptCLIENT SERVER IN OS.ppt
CLIENT SERVER IN OS.pptsuman yadav
 
2 08 client-server architecture
2 08 client-server architecture2 08 client-server architecture
2 08 client-server architecturejit_123
 
Client Server Architecture
Client Server ArchitectureClient Server Architecture
Client Server ArchitectureRence Montanes
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web Server
Gagandeep Singh
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
Bhargav Amin
 
Clientserver Presentation
Clientserver PresentationClientserver Presentation
Clientserver PresentationTuhin_Das
 
Web servers
Web serversWeb servers
Web servers
Kuldeep Kulkarni
 
Presentation about servers
Presentation about serversPresentation about servers
Presentation about servers
Sasin Prabu
 

Viewers also liked (14)

A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)
 
Web server
Web serverWeb server
Web server
 
What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)
 
CLIENT SERVER IN OS.ppt
CLIENT SERVER IN OS.pptCLIENT SERVER IN OS.ppt
CLIENT SERVER IN OS.ppt
 
2 08 client-server architecture
2 08 client-server architecture2 08 client-server architecture
2 08 client-server architecture
 
Client Server Architecture
Client Server ArchitectureClient Server Architecture
Client Server Architecture
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web Server
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Web servers
Web serversWeb servers
Web servers
 
Clientserver Presentation
Clientserver PresentationClientserver Presentation
Clientserver Presentation
 
Web servers
Web serversWeb servers
Web servers
 
Presentation about servers
Presentation about serversPresentation about servers
Presentation about servers
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
 

Similar to Client Web

Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
Rob Bontekoe
 
jQuery
jQueryjQuery
jQuery
jQueryjQuery
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
AnamikaRai59
 
Learning Svelte
Learning SvelteLearning Svelte
Learning Svelte
Christoffer Noring
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
Cyril Balit
 
Javascript 2
Javascript 2Javascript 2
Javascript 2
pavishkumarsingh
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
www.netgains.org
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
Shumpei Shiraishi
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
Timothy Fisher
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
orestJump
 
J query
J queryJ query
HTML5 and Mobile
HTML5 and MobileHTML5 and Mobile
HTML5 and Mobiledoodoofish
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
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
 
Javascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & TricksJavascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & TricksHjörtur Hilmarsson
 

Similar to Client Web (20)

Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
jQuery
jQueryjQuery
jQuery
 
jQuery
jQueryjQuery
jQuery
 
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
 
Learning Svelte
Learning SvelteLearning Svelte
Learning Svelte
 
Devoxx 2014-webComponents
Devoxx 2014-webComponentsDevoxx 2014-webComponents
Devoxx 2014-webComponents
 
Javascript 2
Javascript 2Javascript 2
Javascript 2
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
course js day 3
course js day 3course js day 3
course js day 3
 
J query training
J query trainingJ query training
J query training
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
 
Jquery
JqueryJquery
Jquery
 
J query
J queryJ query
J query
 
HTML5 and Mobile
HTML5 and MobileHTML5 and Mobile
HTML5 and Mobile
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
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...
 
Introducing jQuery
Introducing jQueryIntroducing jQuery
Introducing jQuery
 
Javascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & TricksJavascript MVC & Backbone Tips & Tricks
Javascript MVC & Backbone Tips & Tricks
 

More from Markiyan Matsekh

How we made Apple Watch Tesla App
How we made Apple Watch Tesla AppHow we made Apple Watch Tesla App
How we made Apple Watch Tesla App
Markiyan Matsekh
 
Wearables Interaction Design
Wearables Interaction DesignWearables Interaction Design
Wearables Interaction Design
Markiyan Matsekh
 
Wearables: the next level of mobility
Wearables: the next level of mobilityWearables: the next level of mobility
Wearables: the next level of mobility
Markiyan Matsekh
 
Enterprise Mobility: Getting Trendy
Enterprise Mobility: Getting TrendyEnterprise Mobility: Getting Trendy
Enterprise Mobility: Getting Trendy
Markiyan Matsekh
 
PhoneGap - What It Actually Is
PhoneGap - What It Actually IsPhoneGap - What It Actually Is
PhoneGap - What It Actually Is
Markiyan Matsekh
 
Big Mystification Theory
Big Mystification TheoryBig Mystification Theory
Big Mystification Theory
Markiyan Matsekh
 
Html5 - examples
Html5 - examplesHtml5 - examples
Html5 - examples
Markiyan Matsekh
 
Html5 - ready yet?(ukr)
Html5 - ready yet?(ukr)Html5 - ready yet?(ukr)
Html5 - ready yet?(ukr)
Markiyan Matsekh
 

More from Markiyan Matsekh (8)

How we made Apple Watch Tesla App
How we made Apple Watch Tesla AppHow we made Apple Watch Tesla App
How we made Apple Watch Tesla App
 
Wearables Interaction Design
Wearables Interaction DesignWearables Interaction Design
Wearables Interaction Design
 
Wearables: the next level of mobility
Wearables: the next level of mobilityWearables: the next level of mobility
Wearables: the next level of mobility
 
Enterprise Mobility: Getting Trendy
Enterprise Mobility: Getting TrendyEnterprise Mobility: Getting Trendy
Enterprise Mobility: Getting Trendy
 
PhoneGap - What It Actually Is
PhoneGap - What It Actually IsPhoneGap - What It Actually Is
PhoneGap - What It Actually Is
 
Big Mystification Theory
Big Mystification TheoryBig Mystification Theory
Big Mystification Theory
 
Html5 - examples
Html5 - examplesHtml5 - examples
Html5 - examples
 
Html5 - ready yet?(ukr)
Html5 - ready yet?(ukr)Html5 - ready yet?(ukr)
Html5 - ready yet?(ukr)
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 

Client Web

  • 1. A brief view at client web Markiyan Matsekh Web developer
  • 2.
  • 3.
  • 4.
  • 5.
  • 7. HTTP HTML CSS JS
  • 8. Transport Content Appearance Behavior
  • 9.
  • 10. Http (HyperText Transfer Protocol) – is a deal between client and server on how to deliver data
  • 11. Http - Request/Response model - Stateless - Operates with text
  • 12. How to transfer large binary files through protocol which operates with text?
  • 13. How to maintain state in stateless protocol?
  • 14. How to get updates from server when all you can do is ask for?
  • 15. Http methods - Get - Post - Put - Delete - (few less used)
  • 16.
  • 17. Time for a small demo
  • 19. Https - Agree on PreMasterSecret - Encrypt traffic with it - Send data safely
  • 20.
  • 21. Html (HyperText Markup Language) – is a tool for describing contents with pre-defined limited set of words
  • 22. Is a set of rules, by which browser reads this description
  • 23.
  • 24. <form name="input" action=“your_url" method="get"> Text: <input type=“text" name=“text” /> Radio: <input type="checkbox" name=“radio"/> <input type="submit" value="Submit" /> </form> Here comes Http
  • 25. The number of html elements is growing… Because what really matters nowadays…
  • 26.
  • 27.
  • 28. Html5 is just a logical step in evolution of web ordo ab chao After chaos comes order
  • 29.
  • 30. Css (Cascading Style Sheets) – is a way of describing how your contents should look
  • 31.
  • 32.
  • 34. Css rules priorities - #id == 3 - .classname == 2 - [attr] == 2 - el == 1 Sum = … -> order -> priority = …
  • 35.
  • 36.
  • 37. JavaScript – is a powerful programming language, embedded into the browsers, letting us control the behavior of contents
  • 38. Unobtrusive JavaScript 10 years ago <body bgcolor=“#000”> BAD! Now we move styles into separate files body { background-color: #000; } Same with javascript. We put him into separate file.
  • 39. Bad, mixing JavaScript with HTML <button type="button“ onclick=“document.getElementById(„photo').style.color='red';“> Click Me </button> <div id=“photo”>I am photo</div>
  • 40. Unobtrusive JavaScript <button type="button" id="testButton"> Click Me <-clean HTML </button> <script type="text/javascript"> window.onload = init; function init() { document.getElementById('testButton').onclick = makeItRed; } function makeItRed() { document.getElementById(„photo').style.color = 'red'; }; </script>
  • 41. HTTP HTML CSS JS
  • 42. Transport Content Appearance Behavior
  • 44. Events • World Wide Web – it’s events that make it all happen 1 Set up the user interface. 2 Wait for something interesting to happen. 3 React accordingly. 4 Repeat.
  • 45. Netscape Event Model (march 1996) DOM Level 0 Event Model • Hanlder function is assigned to attribtues on html element (onclick) <button id=“button1” value=“I‟m button” onclick=“alert(„I‟am clicked‟)” /> <script type="text/javascript"> $(function() { $(„#button1‟)[0].onfocus = function(event) { console.log(„Focused!‟); } }); </script>
  • 46. Across the browsers? 1. IE doesn’t invoke function with ‘event’ $(„#button1‟)[0].onfocus = function(event) { if (!event) event = window.event; } 2. IE has event.target instead of event.srcElement: var target = (event.target) ? event.target : event.srcElement; $(„#button1‟)[0].onfocus = function(event) { if (!event) event = window.event; var target = (event.target) ? event.target : event.srcElement; }
  • 48. Event bubbling document.onclick = function(event) { alert(event.target.tagName); } Events bubbling (propagation) Browsers: event.stopPropagation(); IE: event.cancelBubble = true; These don’t bubble: focus, blur; change, submit Events default actions <form name=“myform” onsubmit=“return false;”></form|> <a href=“http://www.mysite.com” onclick=“return false;”></a> Browsers: event.preventDefault(); IE: event.returnValue = false; event.currentTarget – doesn’t work on IE
  • 49. The DOM Level 2 Event Model (november2000) function doFirstThing() { } function doSecondThing() { } addEventListener(eventType, listener, useCapture) someElement.addEventListener(„click‟, doFirstThing, false); someElement.addEventListener(„click‟, doSecondThing, false); // (порядок виконання не гарантується) IE: attachEvent(eventName, handler); // window.event :( someElement.attachEvent(„onclick‟, doFirstThing); someElement.attachEvent(„onclick‟, doSecondThing);
  • 51. What is jQuery? $(), jQuery() – is function, just another piece of js code. But more pleasant one var jQuery = function(selector, context) { return new jQuery.fn.init(selector, context); } jQuery.fn.init - returns wrapped set
  • 53.
  • 54. $(selector).action() <div>Some text</div> <div class=“winter”>Winter text</div> <script type=“text/javascript”> $('div.winter').hide(); // jQuery chaining $('div.winter').hide().show(); $('div.winter').hide().show().removeClass('winter').addClass('spring'); // same as: var myDiv = $('div.winter'); myDiv.hide(); myDiv.show(); myDiv.removeClass('winter'); myDiv.addClass('spring'); </script>
  • 55. CSS, or jQuery selectors p a { color: green; } $(“p a”).css(„color‟, „green‟); $("p:even"); $("tr:nth-child(1)"); $("body > div"); $("a[href$=pdf]"); $("body > div:has(a)");
  • 56. The jQuery Event Model $(„img‟).bind(„click‟, function(event) { alert(„Image clicked ‟ + $(this).attr(„alt‟)); }); • Unified way of adding event handlers • Easy to add many handlers at once • Standard names (click, focus); • ‘event’ is always present and in the same form • Unified way of canceling and preventing default actions (event.preventDefault()) (event.cancelBubble())
  • 57.
  • 58. Ajax (Asynchronous JavaScript and Xml) – is a chance to reload the content without reloading the whole page
  • 59. Usual Ajax workflow 1. Simple HTTP Get through click 2. Page loads javascript logic for ajax 3. Certain actions lead user to async ajax requests 4. Browser sends request to server without reloading page 5. Server examines that the request is async 6. Server s sends back piece of html or json 7. Client gets response and applies it to page
  • 60. Ajax lets us use more HTTP then <form> element
  • 61. Don’t forget! • Javascript is tricky • Javascript is single-threaded • Events run it all • Use Ajax wisely • Use Cookies wisely
  • 62.
  • 63. And now time for another demo

Editor's Notes

  1. Intensive development of the web caused too hasty decisions and lack of standards. Later monopolization of the market be IE killed web for years…
  2. You can make add any features to your toy, as long as it conforms standards
  3. You can make add any features to your toy, as long as it conforms standards
  4. These are the 4 main concepts of client web
  5. No questions? Then let me ask you – how do you transfer binary data as text? Big data?And how do you maintain state?
  6. Why? Remember mobile phones boom? And planshets? They all render data as the user got used to, not how we want it to be rendered.
  7. These are the 4 main concepts of client web