SlideShare una empresa de 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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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 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
 

Más 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
 

Más 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

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

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 del 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