Your SlideShare is downloading. ×
0
Mobile JavaScript	
javascriptz right in yo hands, mawfocker
token “me” slide


 Web developer / Master Exploder at Nitobi Software
 SFU graduate
 Big fan of the open web
 Bigger Canu...
Mobile: How’s it doing?
Browsing ~3% of all browsing takes
 Today, by Device Category Trend         place on a mobile devi...
Browsers everywhere!
WebKit FTW

The major browser platform moving forward
Apple started it
Android jumped on
Even RIM pulled their head out of...
But...
 Still have:
   Internet Explorer Mobile; now
   with extra non-compliance!
   Old BlackBerry Browser, it’s so
   b...
so wtf do we do?




(other than drink beer)
codes that help
Peter Higgins’ has.js is rad
SunSpider is sweet
Sputnik is also neat
has.js
 Peter Higgins, Dojo project lead, put this out there as of
 JSConf.eu 2010.
 A JavaScript feature detection librar...
SunSpider


A JavaScript benchmark.
Part of the WebKit project.
Sputnik


Google project, a JavaScript conformance test suite
against the ECMA-262 spec
Over 5000 tests
The numbers
Android (2.2)

 has.js: apparently a few css and DOM tests fail!
 function bind fails (?), and full <input> support is not...
iPhone (4)

 has.js: same css, dom and function bind issues as
 Android. Better <input> support too. es5 is lacking, but
 ...
Shitty BlackBerry, slide 1
BlackBerry OS 5.0
Shitty BlackBerry, slide 2
has.js results
 array has no reduce or isarray methods, some regexp tests fail

 no audio suppo...
Shitty BlackBerry, slide 3
SunSpider and Sputnik

 SunSpider: Didn’t finish, each test ran on average
 4000ms (compared to ...
BlackBerry 6 (WebKit)

has.js: better than both Android and iPhone. Full event
support (unlike Android/iPhone). Websockets...
Windows Phone 7
has.js: All array tests fail, no audio support,
getelementbyid ignores case, getelementsbytagname
returns ...
Palm

has.js: pretty solid overall. createAttribute apparently
fails. canvas, audio, video works. sqlite and
localstorage ...
Final words


 Know your enemy
 Pick your battles
BEER TIME NAO




Thanks!
Upcoming SlideShare
Loading in...5
×

Mobile JavaScript

1,570

Published on

An overview of the state of JavaScript in the mobile world. Runs some tests on six popular and up-and-coming mobile browsers.

Published in: Technology
2 Comments
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total Views
1,570
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
2
Likes
0
Embeds 0
No embeds

No notes for slide

  • other stuff:
    - one of many contributors/maintainers of PhoneGap, XUI, lawnchair

  • other interesting tidbits:
    - financial firm Morgan Stanley predicts mobile browsing will outstrip desktop by 2015

  • web as a platform; fuck native
    if we could harness the power of browsers we could get out to so many people
  • -closest thing we have to a unified platform on the web

  • - initially, WP7 had IE 6/7 hybrid. latest version has 7/8 hybrid. sources say the browser is separate from the rest of the platform and can be upgraded much easier than the OS. Also MSFT has hinted that it will be moving WP7 to IE9.


  • - checks for proper behaviour in your basic types, functions (binding et al), common browser bugs.
  • tons of benchmark tests, run a bunch of times for each test to come up with a 95% confidence interval
  • hard to read tho. you need to know the ecma spec to make any real sense of it. but a good guide for general ecmascript conformance.



  • so much fail I need many slides to show this off

  • re: css. it DOES have position: fixed though!
  • no surprises here



  • know your enemy: look at your analytics. if youre building a mobile site, who visits your &amp;#x2018;desktop&amp;#x2019; site?
    pick your battles: some of these environments really suck. building a web app on one platform might take four or five times more time than building it for another one.

  • Transcript of "Mobile JavaScript"

    1. 1. Mobile JavaScript javascriptz right in yo hands, mawfocker
    2. 2. token “me” slide Web developer / Master Exploder at Nitobi Software SFU graduate Big fan of the open web Bigger Canucks fan
    3. 3. Mobile: How’s it doing? Browsing ~3% of all browsing takes Today, by Device Category Trend place on a mobile device; November, 2009 to September, 2010 Apparently 6% in Asia. Month Desktop Mobile Consol November, 2009 98.65% 0.04% December, 2009 98.36% 0.05% January, 2010 98.19% 0.05%
    4. 4. Browsers everywhere!
    5. 5. WebKit FTW The major browser platform moving forward Apple started it Android jumped on Even RIM pulled their head out of their ass and made the switch
    6. 6. But... Still have: Internet Explorer Mobile; now with extra non-compliance! Old BlackBerry Browser, it’s so bad it doesn’t have a name
    7. 7. so wtf do we do? (other than drink beer)
    8. 8. codes that help Peter Higgins’ has.js is rad SunSpider is sweet Sputnik is also neat
    9. 9. has.js Peter Higgins, Dojo project lead, put this out there as of JSConf.eu 2010. A JavaScript feature detection library, using JavaScript. http://github.com/phiggins42/has.js
    10. 10. SunSpider A JavaScript benchmark. Part of the WebKit project.
    11. 11. Sputnik Google project, a JavaScript conformance test suite against the ECMA-262 spec Over 5000 tests
    12. 12. The numbers
    13. 13. Android (2.2) has.js: apparently a few css and DOM tests fail! function bind fails (?), and full <input> support is not there. No es5 or svg. SunSpider: 6121ms Sputnik: All tests ran, 226/5246 failed (4.3%)
    14. 14. iPhone (4) has.js: same css, dom and function bind issues as Android. Better <input> support too. es5 is lacking, but full SVG support (woot)? SunSpider: 10252 ms Sputnik: Crashed mobile safari... 3.7% tests fail (137/3746)
    15. 15. Shitty BlackBerry, slide 1 BlackBerry OS 5.0
    16. 16. Shitty BlackBerry, slide 2 has.js results array has no reduce or isarray methods, some regexp tests fail no audio support, no canvas there are lots of css bugs/lack of support: overflow, border-radius, transforms, text- overflow, opacity. super weak date support; no toisostring, now or tojson. no native JSON tools (just grab json2.js from json.org) no xhr upload events, any type of offline storage (OTHER THAN GEARS, YES!!!!) no svg, video or vml
    17. 17. Shitty BlackBerry, slide 3 SunSpider and Sputnik SunSpider: Didn’t finish, each test ran on average 4000ms (compared to Android’s ~100ms). Sputnik: Can’t even get to the test runner!
    18. 18. BlackBerry 6 (WebKit) has.js: better than both Android and iPhone. Full event support (unlike Android/iPhone). Websockets and worker support, that is fucking awesome. Full storage options. SVG is super performant on it SunSpider: 26131 ms Sputnik: Crashed browser at 1%
    19. 19. Windows Phone 7 has.js: All array tests fail, no audio support, getelementbyid ignores case, getelementsbytagname returns comment nodes, so much more fail! css bugs galore; see IE6. no event.stopPropagation or preventDefault BUT... VML!!!! SunSpider: 145050 ms... Sputnik: NOPE
    20. 20. Palm has.js: pretty solid overall. createAttribute apparently fails. canvas, audio, video works. sqlite and localstorage options are there too. SunSpider: 39193 ms Sputnik: nope
    21. 21. Final words Know your enemy Pick your battles
    22. 22. BEER TIME NAO Thanks!
    1. A particular slide catching your eye?

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

    ×