SlideShare une entreprise Scribd logo
1  sur  44
Télécharger pour lire hors ligne
Javascript Moderno
Jean Carlo Nascimento aka Suissa
Links
               nosqlbr.com.br
              jquerybrasil.org
           frontendbrasil.com.br
          javascriptbrasil.com.br
        comoprogramarphp.com.br
             github.com/suissa
              about.me/suissa
                 @osuissa
Breve História do Javascript
"JS had to 'look like Java' only less so, be
Java’s dumb kid brother or boy-hostage
sidekick. Plus, I had to be done in ten
days or something worse than JS would
have happened". Brendan Eich
LiveScript
Como selecionar um elemento?
jQuery
$('#container');
Javascript Moderno
var container = document.querySelector
('#container');
Javascript Velho
var container = document.getElementById
('container');
Como procurar li's?
jQuery
$('#container').find('li');
Javascript Moderno
var lis = document.querySelectorAll
('#container li');
Javascript Velho
var lis = document
          .getElementById('container')
          .getElementsByTagName('li');
Trabalhando com classes
jQuery
$('#box').addClass('wrap');
$('#box').removeClass('wrap');
$('#box').toggleClass('wrap');
Javascript Moderno
var container = document.querySelector
('#box');

container.classList.add('wrap');
container.classList.remove('wrap');
container.classList.toggle('wrap');
Javascript Velho
var box = document.getElementById('box'),
hasClass = function (el, cl) {
    var regex = new RegExp('(?:s|^)' + cl + '(?:s|$)');
    return !!el.className.match(regex);
},
addClass = function (el, cl) {
    el.className += ' ' + cl;
},
removeClass = function (el, cl) {
         var regex = new RegExp('(?:s|^)' + cl + '(?:s|$)');
         el.className = el.className.replace(regex, ' ');
},
toggleClass = function (el, cl) {
    hasClass(el, cl) ? removeClass(el, cl) : addClass(el, cl);
};

addClass(box, 'wrap');
removeClass(box, 'wrap');
toggleClass(box, 'wrap');
HTML5
Node.js
Node.js
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno

Contenu connexe

Similaire à Javascript moderno

Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
Chris Alfano
 

Similaire à Javascript moderno (8)

H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍
H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍
H3 경쟁력있는 웹앱 개발을 위한 모바일 js 프레임웍
 
An Introduction to Jquery
An Introduction to JqueryAn Introduction to Jquery
An Introduction to Jquery
 
So long, jQuery, and thanks for all the fish!
So long, jQuery, and thanks for all the fish!So long, jQuery, and thanks for all the fish!
So long, jQuery, and thanks for all the fish!
 
Jquery News Packages
Jquery News PackagesJquery News Packages
Jquery News Packages
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricks
 
Let jQuery Rock Your World
Let jQuery Rock Your WorldLet jQuery Rock Your World
Let jQuery Rock Your World
 
Javascript in Plone
Javascript in PloneJavascript in Plone
Javascript in Plone
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 

Plus de Suissa

Secot banco de dados no sql de código aberto
Secot   banco de dados no sql de código abertoSecot   banco de dados no sql de código aberto
Secot banco de dados no sql de código aberto
Suissa
 
Flisol - Nodejs e MongoDb o casamento perfeito
Flisol - Nodejs e MongoDb o casamento perfeitoFlisol - Nodejs e MongoDb o casamento perfeito
Flisol - Nodejs e MongoDb o casamento perfeito
Suissa
 
Fisl banco de dados no sql de código aberto
Fisl   banco de dados no sql de código abertoFisl   banco de dados no sql de código aberto
Fisl banco de dados no sql de código aberto
Suissa
 
Curso mongo db com php
Curso mongo db com phpCurso mongo db com php
Curso mongo db com php
Suissa
 
Html5 storage api
Html5 storage apiHtml5 storage api
Html5 storage api
Suissa
 
Diagrama de classe
Diagrama de classeDiagrama de classe
Diagrama de classe
Suissa
 

Plus de Suissa (20)

ES6 funcional TDC - Suissa
ES6 funcional TDC - SuissaES6 funcional TDC - Suissa
ES6 funcional TDC - Suissa
 
Mongoose - Melhores práticas usando MongoDB e Node.js
Mongoose - Melhores práticas usando MongoDB e Node.jsMongoose - Melhores práticas usando MongoDB e Node.js
Mongoose - Melhores práticas usando MongoDB e Node.js
 
Atomic design
Atomic design Atomic design
Atomic design
 
Palestra node.js
Palestra   node.js Palestra   node.js
Palestra node.js
 
Be MEAN JSConf Uruguay - Suissa
Be MEAN JSConf Uruguay - SuissaBe MEAN JSConf Uruguay - Suissa
Be MEAN JSConf Uruguay - Suissa
 
Atomic design
Atomic designAtomic design
Atomic design
 
Be MEAN
Be MEANBe MEAN
Be MEAN
 
Be mean
Be meanBe mean
Be mean
 
Devcast node.js e mongo db o casamento perfeito
Devcast   node.js e mongo db o casamento perfeitoDevcast   node.js e mongo db o casamento perfeito
Devcast node.js e mongo db o casamento perfeito
 
Secot banco de dados no sql de código aberto
Secot   banco de dados no sql de código abertoSecot   banco de dados no sql de código aberto
Secot banco de dados no sql de código aberto
 
Flisol - Nodejs e MongoDb o casamento perfeito
Flisol - Nodejs e MongoDb o casamento perfeitoFlisol - Nodejs e MongoDb o casamento perfeito
Flisol - Nodejs e MongoDb o casamento perfeito
 
Ph pn rio 2012 - conheça seu primeiro banco de dados orientado a grafos
Ph pn rio 2012 - conheça seu primeiro banco de dados orientado a grafosPh pn rio 2012 - conheça seu primeiro banco de dados orientado a grafos
Ph pn rio 2012 - conheça seu primeiro banco de dados orientado a grafos
 
DevDay - O elo perdido: sincronizando webapps
DevDay - O elo perdido: sincronizando webappsDevDay - O elo perdido: sincronizando webapps
DevDay - O elo perdido: sincronizando webapps
 
DevDay - MongoDb no mundo real - slides
DevDay - MongoDb no mundo real - slidesDevDay - MongoDb no mundo real - slides
DevDay - MongoDb no mundo real - slides
 
Fisl banco de dados no sql de código aberto
Fisl   banco de dados no sql de código abertoFisl   banco de dados no sql de código aberto
Fisl banco de dados no sql de código aberto
 
Mongo db no mundo real slides
Mongo db no mundo real   slidesMongo db no mundo real   slides
Mongo db no mundo real slides
 
Curso mongo db com php
Curso mongo db com phpCurso mongo db com php
Curso mongo db com php
 
Html5 storage api
Html5 storage apiHtml5 storage api
Html5 storage api
 
Palestra sobre MongoDB com PHP no PHP'n'Rio
Palestra sobre MongoDB com PHP no PHP'n'Rio Palestra sobre MongoDB com PHP no PHP'n'Rio
Palestra sobre MongoDB com PHP no PHP'n'Rio
 
Diagrama de classe
Diagrama de classeDiagrama de classe
Diagrama de classe
 

Dernier

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
Safe Software
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Javascript moderno