38

Javascript - Agora a coisa ficou séria

Embed Size (px)

Citation preview

github.com/luizstacio

fb.com/luizstacio

Script

Fracamente tipada

Tipagem dinâmica

Orientado a objetos

Baseada em protótipos

JavaScript

1995

JScript

1996

1996

ECMAscript

ES

2005$('css-selector-cross-browser')

$('css-selector-cross-

browser').click(function(){});

$('css-selector-cross-

browser').animate({

left: 0

}, 1000);

$.ajax({

type: 'POST',

url: 'post.php',

data: { text: 'oi sou um

json' }

}).done(function (data) {

alert(data)

});

Aplicações

Aplicações SPA

2008

Ryan Dhal

var http = require('http');

http.createServer(function (req, res) {

res.writeHead(200, { 'Content-Type': 'text/plain'

});

res.end('Hello Node.JS!!');

}).listen(8080);

App.js

$ node app.js

Terminal

2009NoSQL

Livre de esquema

Orientados a documentos

Bson (JSON binário)

$ mongod

Terminal

$ mongo

$ use teste

$ db.teste.insert({ name: 'luiz', idade: 23 })

$ mongo

$ use teste

$ db.teste.find({ name: 'luiz' })

{ "_id" : ObjectId("53828cfa186e5937498725e3"),

"name" : "luiz", "idade" : 22 }

Embarcado

var five = require('johnny-five'),

board = new five.Board();

board.on('ready', function () {

(new five.Led(13)).strobe();

});

App.js

$ node app.js

Terminal

Single Language Application

http://jquery.com/

https://www.mongodb.com/

http://www.nodejs.org/

http://phonegap.com/

http://www.appcelerator.com/titanium/

https://github.com/luizstacio/fitcricuma

Referências

Exemplos