SlideShare uma empresa Scribd logo
1 de 64
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

Mais conteúdo relacionado

Mais procurados

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 SiddiquiMuhammad Ehtisham Siddiqui
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentationMevin Mohan
 
jQuery Mobile with HTML5
jQuery Mobile with HTML5jQuery Mobile with HTML5
jQuery Mobile with HTML5madhurpgarg
 
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 HTML5Todd 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 eventsgvbmail
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and ModernizrJussi Pohjolainen
 

Mais procurados (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
 

Destaque

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
 
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 ServerGagandeep Singh
 
Client server architecture
Client server architectureClient server architecture
Client server architectureBhargav Amin
 
Clientserver Presentation
Clientserver PresentationClientserver Presentation
Clientserver PresentationTuhin_Das
 
Presentation about servers
Presentation about serversPresentation about servers
Presentation about serversSasin Prabu
 

Destaque (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)
 

Semelhante a Client Web

Semelhante a 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
 

Mais de 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 AppMarkiyan Matsekh
 
Wearables Interaction Design
Wearables Interaction DesignWearables Interaction Design
Wearables Interaction DesignMarkiyan Matsekh
 
Wearables: the next level of mobility
Wearables: the next level of mobilityWearables: the next level of mobility
Wearables: the next level of mobilityMarkiyan Matsekh
 
Enterprise Mobility: Getting Trendy
Enterprise Mobility: Getting TrendyEnterprise Mobility: Getting Trendy
Enterprise Mobility: Getting TrendyMarkiyan Matsekh
 
PhoneGap - What It Actually Is
PhoneGap - What It Actually IsPhoneGap - What It Actually Is
PhoneGap - What It Actually IsMarkiyan Matsekh
 

Mais de 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)
 

Último

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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

Notas do Editor

  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