30. JavaScript
ECMAScript
5
Strict
Mode
!
! “Use Strict”;
!
! var
scope
! with
! arguments.callee
! …
! For
“The
Good
Part”
! eval
is
evil
31. jQuery
Library
The
Dollar
!
DOM
Element
$( )
jQuery
$(”#neat").addClass("ohmy").show("slow");
var el = document.getElementById(‘neat’);
if (!/bohmyb/.test(el.className) el.className += ‘ ohmy’;
33.
!
if (!window.FileReader) { … }
if (!document.createElement(‘canvas’).getContext) {
…
}
if (!Array.prototype.forEach) { … }
! Modernizer
! Polyfill JavaScript
(shim)
34. Polyfill
if (!Array.prototype.forEach) {
Array.prototype.forEach = function(c,d){var
e,a;if(this==null)throw new TypeError(" this
is null or not defined");var b=Objec
t(this),g=b.length>>>0;if({}.toString.cal
l(c)!="[object Function]")throw new TypeErro
r(c+" is not a function");d&&(e=d);fo
r(a=0;a<g;){var f;a in b&&(f=b[Pk],c.cal
l(e,f,a,b));a++}};
}
Mozilla
Developer
Network
Closure
Complier
42. Web
Workers
!
while(true)
while(true) { snowIE_NS6(); };
! Web
Workers
thread
while
loop
var worker = new Worker(‘./snow_calc.js’);
worker.onmessage = function (ev) {
…
};
43. Web
Workers
!
DOM
l window
global
object
l XMLHKpRequest
importScript()
l console.log()
(T____T)
! postMessage()
scope
48. Beyond
Browsers
! Site-‐specific
Browsers
! HTA:
HTML
Applica(ons
(.hta)
! Ac(veX
Control
Windows
IE
! Web
OS
! IE4
Ac(ve
Desktop 1997
! Windows
Widgets
! IE9+
! Windows
8
Metro-‐style
App
!
OS
! G
C
(1966-‐1997)
50. Metro UI start screen, http://www.microsoft.com/presspass/events/build/
51. Going
Mobile
!
! Web
App
as
App
! A
i
Add
to
Home
Screen
! PhoneGap
Windows
Phone
7
52. JavaScript
is
more
than
web
!
JavaScript
! Windows
Script
Host
!
! Node.JS
! Titanium
! Mozilla
Applica(on
Plaborm
(XUL
Runner)
53.
54. Toward
a
more
beau(ful
web
! Web
! Web
! Single
toolset
for
all
plaborm
!
! jQuery Modernizr
!
55.
56. HTML5 (
DEV311
)
9/15/2011
10:20
–
11:30
hKp://caniuse.com/
(When
can
I
use
…
)
hKp://diveintohtml5.org/
(Dive
into
HTML5
HTML5
)
( )
57.
hKp://technet.microsow.com/zh-‐ hKp://msdn.microsow.com/zh-‐
tw/default.aspx
tw/default.aspx
Resources
for
IT
Professionals
Resources
for
Developers
windows.microsow.com/zh-‐TW/internet-‐explorer/products/ie/home
Microsow
Internet
Explorer
9
ie.microsow.com/testdrive/
Internet
Explorer
Test
Drive
(
IE
10
Preview
2)
( )
hKp://msdn.microsow.com/zh-‐tw/ie/gg192966.aspx
Internet
Explorer