Node.js - Demnächst auf einem Server in Ihrer Nähe
-
Upload
ralph-winzinger -
Category
Software
-
view
138 -
download
1
Transcript of Node.js - Demnächst auf einem Server in Ihrer Nähe
<a href="#" data-role="button" data-theme="c" data-rel="back">No</a> </div> </div> <script id="personTmpl" type="text/x-jquery-tmpl"> <li> <a href="javascript:addPerson('${username}')"><img src="${iconLink}" <div class="ui-li-count">${numFollowers}</div> </li> </script>
<script type="text/javascript"> // dialogs function areYouSure(text1, text2, button, callback) { $("#sure .sure-1").text(text1); $("#sure .sure-2").text(text2); $("#sure .sure-do").text(button).on("click.sure", function() { callback(); $(this).off("click.sure"); }); $.mobile.changePage("#sure", {role: 'dialog'}); }
�3BHB�/C16�
/C4
37<3;�(3@D3
@�7<
�6@3@�#/363
�
Mittwoch, 19. September 12
,3@�07<�716C<2�E/A�BCJ�716�673@�
������������ ������������������������������ ������
��/D/(1@7>B
�<=238A
�>CBB7<5�ABC44�B=53B63@
Mittwoch, 19. September 12
�7AB=@G��%/@B���/D/(1@7>B
�@3<2/<��716��������#3BA1/>3
#3BA1/>3��=;;C<71/B=@
Mittwoch, 19. September 12
�7AB=@G��%/@B���/D/(1@7>B
�@3<2/<��716��������#3BA1/>3
#3BA1/>3��=;;C<71/B=@
$>3<�(=C@13������
Mittwoch, 19. September 12
�7AB=@G��%/@B���/D/(1@7>B
�@3<2/<��716��������#3BA1/>3
#3BA1/>3��=;;C<71/B=@
$>3<�(=C@13������
"=H7::/����
Mittwoch, 19. September 12
�7AB=@G��%/@B���/D/(1@7>B
�@3<2/<��716��������#3BA1/>3
�)$
#3BA1/>3��=;;C<71/B=@
$>3<�(=C@13������
"=H7::/����
Mittwoch, 19. September 12
"71@=A=4B�������#3BA1/>3����������/D/+� �(
„%:CA��7B�6/2�B=�03�2=<3�7<�B3<�2/GA=@�A=;3B67<5�E=@A3�6/2�6/>>3<2K
�7AB=@G��%/@B���/D/(1@7>B
Mittwoch, 19. September 12
,/A�7AB��/D/(1@7>B�
alert(„Hello World“);
(31C@7BG��:/EA-(( (16:316B3��@E37B3@C<53<
4C3@��)"!�(37B3<
.�9
�%*�!=/2
Mittwoch, 19. September 12
,/A�7AB��/D/(1@7>B�
alert(„Hello World“);
(31C@7BG��:/EA-(( (16:316B3��@E37B3@C<53<
4C3@��)"!�(37B3<
.�9
�%*�!=/2
���-Mittwoch, 19. September 12
37<3��4/AB��5/<H�<=@;/:3�(>@/163
)G>3<��#C;03@��(B@7<5���==:3/<��$0831B���@@/G
$>3@/B=@3<�� =<B@=::AB@C9BC@3<��'35�F>
#/#��<C::��C<2347<32
�C<9B7=<3<
E3/9
AB@=<5
2G</;71AB/B71
,/A�7AB��/D/(1@7>BE7@9:716�
Mittwoch, 19. September 12
37<3��4/AB��5/<H�<=@;/:3�(>@/163
)G>3<��#C;03@��(B@7<5���==:3/<��$0831B���@@/G
$>3@/B=@3<�� =<B@=::AB@C9BC@3<��'35�F>
#/#��<C::��C<2347<32
�C<9B7=<3<
E3/9
AB@=<5
2G</;71AB/B71
,/A�7AB��/D/(1@7>BE7@9:716�
Mittwoch, 19. September 12
37<3��4/AB��5/<H�<=@;/:3�(>@/163
)G>3<��#C;03@��(B@7<5���==:3/<��$0831B���@@/G
$>3@/B=@3<�� =<B@=::AB@C9BC@3<��'35�F>
#/#��<C::��C<2347<32
�C<9B7=<3<
E3/9
AB@=<5
2G</;71AB/B71
http://i
s.gd/hc2
012
,/A�7AB��/D/(1@7>BE7@9:716�
Mittwoch, 19. September 12
�7<�>//@��753<637B3<
����������
4=@��</;3�7<�=0831B��
(1=>7<5
D/@������<716B�D/@�
B67A���B6/B
�C<9B7=<3<�A7<2�47@AB�1:/AA�17B7H3<A
=0831B�:7<9/53
Mittwoch, 19. September 12
$0839B3�;�,3A3<B:7163<� 3G�+/:C3�%/7@A
rw = { firstname:“ralph“, lastname:“winzinger“};
console.log(rw.firstname);console.log(rw[“lastname“]);
rw.title = “architect“;console.log(rw);
rw.dump = function() { console.log(this);}
Mittwoch, 19. September 12
$0839B3!7<9/53���%@=B=BG>3
obj = {a:"1"}midObj = {b:"2"}topObj = {c:"3"}
obj.__proto__ = midObjmidObj.__proto__ = topObj
obja:“1“
midObjb:“2“
topObjc:“3“
Mittwoch, 19. September 12
$0839B3!7<9/53���%@=B=BG>3
obj = {a:"1"}midObj = {b:"2"}topObj = {c:"3"}
obj.__proto__ = midObjmidObj.__proto__ = topObj
obja:“1“
midObjb:“2“
topObjc:“3“
<=@;/:3@E37A3�D7/� =<AB@C9B=@�
// http://javascript.crockford.com/prototypal.html var derive = function (o) { function F() {}; F.prototype = o; return new F();};
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var greeter = function(name) { console.log(„hello “+name);}greeter(„ralph“);
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var greeter = function(name) { console.log(„hello “+name);}greeter(„ralph“);
var obj = {a:“1“, foo:greeter};obj.foo(„ralph“);
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var greeter = function(name) { console.log(„hello “+name);}greeter(„ralph“);
var obj = {a:“1“, foo:greeter};obj.foo(„ralph“);
first-
class
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var greeter = function(name) { console.log(„hello “+name);}greeter(„ralph“);
var obj = {a:“1“, foo:greeter};obj.foo(„ralph“);
setTimeout(1000, function() { console.log(„hello“); });
first-
class
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var greeter = function(name) { console.log(„hello “+name);}greeter(„ralph“);
var obj = {a:“1“, foo:greeter};obj.foo(„ralph“);
setTimeout(1000, function() { console.log(„hello“); });
first-
class
lambda
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var name = "ralph";var foo = function() { var xy = 1;}var greeter = function() { console.log("hello, "+name); console.log("xy: "+xy);}
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var name = "ralph";var foo = function() { var xy = 1;}var greeter = function() { console.log("hello, "+name); console.log("xy: "+xy);}
lexica
l scop
e
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var name = "ralph";var foo = function() { var xy = 1;}var greeter = function() { console.log("hello, "+name); console.log("xy: "+xy);}
lexica
l scop
e
var wrapper = function() { var name = "ralph"; var greeter = function() { console.log("hello, "+name); } greeter(); return greeter;}
Mittwoch, 19. September 12
�C<9B7=<3<�7@AB��:/AA�17B7H3<A��:/;02/A���1:=AC@3A
var name = "ralph";var foo = function() { var xy = 1;}var greeter = function() { console.log("hello, "+name); console.log("xy: "+xy);}
lexica
l scop
e
var wrapper = function() { var name = "ralph"; var greeter = function() { console.log("hello, "+name); } greeter(); return greeter;}
closur
e
Mittwoch, 19. September 12
�7AB=@G��%/@B��<=238A
'G/<��/6:������"/B63;/B793@
(C32/;3@79/��,30�%@=5@/;;3@
Mittwoch, 19. September 12
�7AB=@G��%/@B��<=238A
'G/<��/6:������"/B63;/B793@
(C32/;3@79/��,30�%@=5@/;;3@
Mittwoch, 19. September 12
�7AB=@G��%/@B��<=238A
'G/<��/6:������"/B63;/B793@
(C32/;3@79/��,30�%@=5@/;;3@
�(�=<4��3@:7<����
Mittwoch, 19. September 12
�7AB=@G��%/@B��<=238A
'G/<��/6:������"/B63;/B793@
(C32/;3@79/��,30�%@=5@/;;3@
�(�=<4��3@:7<����
�=G3<B��C<27<5
Mittwoch, 19. September 12
�7AB=@G��%/@B��<=238A
'G/<��/6:������"/B63;/B793@
�;>:=G33
(C32/;3@79/��,30�%@=5@/;;3@
�(�=<4��3@:7<����
�=G3<B��C<27<5
Mittwoch, 19. September 12
�7AB=@G��%/@B��<=238A
,/@C;�83BHB���73��233�HC�((�(�7AB����������2=16�A16=<����/6@3�/:B���
,30��������-���)"!���8&C3@G
"=07:3����)"!�,30�>>A��8&C3@G"=07:3��>6=<3�/>
�:=C2���7AB@70CB7=<��#3BE=@97<5%3@4=@;/<13HCE/16A
Mittwoch, 19. September 12
�73�<=23��233
(7<5:3�)6@3/232�D3<B:==>
�:73<B
,=@93@A)6@3/2�%==:
1/::0/19A
Mittwoch, 19. September 12
<=238A
�<AB/::/B7=<
!/C4H37BC;530C<5
�=1A
"=2C:3A
�30C557<5
�6/B��<E3<2C<5
Mittwoch, 19. September 12
�<AB/::/B7=<
��EEE<=238A=@5��„7<AB/::K
�6BB>�(3@D3@�A16@3703<
Mittwoch, 19. September 12
�<AB/::/B7=<
��EEE<=238A=@5��„7<AB/::K
�6BB>�(3@D3@�A16@3703<
����(39C<23<�07A�HC;�„7<1=;7<5�@3?C3ABK
Mittwoch, 19. September 12
+���<57<3
0
3000
6000
9000
12000
FF 10 FF 15 Safari 6Chrome 21
67223<�1:/AA3A
�/163A��(B/B7AB793<
HE37��=;>7:3@��937<��<B3@>@3B3@
Mittwoch, 19. September 12
http = require("http");
server = http.createServer(function(req, res) { console.log("incoming request"); });
server.listen(8888, function() { console.log("server started");})
A3@D3@8A
Mittwoch, 19. September 12
#%"#=23�%/19/532�"=2C:3A
�=@3 @2�%/@BG �753<3�"=2C:3
I 6BB>1@G>B=D;
I��3F>@3AAA=193B7=1=<<31B
exports.mylog = function(msg) { console.log(msg);}
Mittwoch, 19. September 12
client z
16/B8A
node app
client xclient y
postMessage(nick, msg) (push)newMessage(nick, msg)
Mittwoch, 19. September 12
client z
16/B8A
node app
client xclient y
postMessage(nick, msg) (push)newMessage(nick, msg)
Mittwoch, 19. September 12