Javascript ModernoJean Carlo Nascimento aka Suissa
Links               nosqlbr.com.br              jquerybrasil.org           frontendbrasil.com.br          javascriptbrasil...
Breve História do Javascript
"JS had to look like Java only less so, beJava’s dumb kid brother or boy-hostagesidekick. Plus, I had to be done in tenday...
LiveScript
Como selecionar um elemento?
jQuery$(#container);
Javascript Modernovar container = document.querySelector(#container);
Javascript Velhovar container = document.getElementById(container);
Como procurar lis?
jQuery$(#container).find(li);
Javascript Modernovar lis = document.querySelectorAll(#container li);
Javascript Velhovar lis = document          .getElementById(container)          .getElementsByTagName(li);
Trabalhando com classes
jQuery$(#box).addClass(wrap);$(#box).removeClass(wrap);$(#box).toggleClass(wrap);
Javascript Modernovar container = document.querySelector(#box);container.classList.add(wrap);container.classList.remove(wr...
Javascript Velhovar box = document.getElementById(box),hasClass = function (el, cl) {    var regex = new RegExp((?:s|^) + ...
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
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Javascript moderno
Upcoming SlideShare
Loading in...5
×

Javascript moderno

1,757

Published on

Palestra sobre Javascript Moderno dada no WOB2012

Published in: Technology
5 Comments
10 Likes
Statistics
Notes
No Downloads
Views
Total Views
1,757
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
17
Comments
5
Likes
10
Embeds 0
No embeds

No notes for slide

Javascript moderno

  1. 1. Javascript ModernoJean Carlo Nascimento aka Suissa
  2. 2. Links nosqlbr.com.br jquerybrasil.org frontendbrasil.com.br javascriptbrasil.com.br comoprogramarphp.com.br github.com/suissa about.me/suissa @osuissa
  3. 3. Breve História do Javascript
  4. 4. "JS had to look like Java only less so, beJava’s dumb kid brother or boy-hostagesidekick. Plus, I had to be done in tendays or something worse than JS wouldhave happened". Brendan Eich
  5. 5. LiveScript
  6. 6. Como selecionar um elemento?
  7. 7. jQuery$(#container);
  8. 8. Javascript Modernovar container = document.querySelector(#container);
  9. 9. Javascript Velhovar container = document.getElementById(container);
  10. 10. Como procurar lis?
  11. 11. jQuery$(#container).find(li);
  12. 12. Javascript Modernovar lis = document.querySelectorAll(#container li);
  13. 13. Javascript Velhovar lis = document .getElementById(container) .getElementsByTagName(li);
  14. 14. Trabalhando com classes
  15. 15. jQuery$(#box).addClass(wrap);$(#box).removeClass(wrap);$(#box).toggleClass(wrap);
  16. 16. Javascript Modernovar container = document.querySelector(#box);container.classList.add(wrap);container.classList.remove(wrap);container.classList.toggle(wrap);
  17. 17. Javascript Velhovar 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);
  18. 18. HTML5
  19. 19. Node.js
  20. 20. Node.js
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×