Javascript – How to avoid the bad parts

This is my five minutes lighting talk presentation in Plone Confrence 2011. It’s a crash course how to write Javascript by following the modern best practices and not in that crappy way when you where still studying web development circa HTML3.

The presentation was originally aimed for Python developers, but suits for anyone with some programming experience and not much Javascript experience.

Discussed topics include: require.js, ECMAScript 5, strict mode, JSLint, this scoping and bind(), binding event handlers using jQuery

Ps. Always when searching Javascript related information in Google et. al. use MDN (Mozilla Developer Network) prefix as otherwise you’ll get misinformation and spammy results. E.g. search “MDN javascript bind” instead of “javascript bind”.

Pps. Put w3cschool.com domain on the black list in your search engine. It’s bad.

Ppps. PDF is available here.

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

10 thoughts on “Javascript – How to avoid the bad parts

  1. Do you have your slides anywhere else? Slideshare Flash Player has had a problem for several months for me where previous and next button presses are mostly ignored or skip slides so I can’t actually read any presentation.

  2. Only if you create an account and jump through similar hoops.

  3. Hi,

    I’m from slideshare… came to this post from Google. We have moved to HTML5, and thats happening in a phased manner… we plan to finish the complete changover from Flash in a couple of months..

    The embed above is not Flash, btw. You can do a text selection to verify.

  4. Don’t use a#someid, simply use #someid, selectors are read from right to left, so anything on the left of #someid is meaningless, since ids are supposed to be unique.
    Avoid using jQuery.live, use jQuery.delegate/jQuery.on (jquery 1.7) : API is easier to understand and more effective.

  5. Samori: Good stuff. The example was not perfect as the whole presentation was written in 30 minutes… so your clarification is good! Also haven’t had time yet to check jQuery 1.7 release as its recent and have been busy with the conf – lots of new exciting stuff there!

  6. @Amit: Whenever I see embeds I always hit the main site (also do this with youtube) as people size the embeds really small – I’m using a 28″ high resolution monitor.

    I can confirm the above embed does indeed not use Flash and works perfectly for me while your main site is using Flash and is hopeless. (Chrome on Linux).

  7. @Jeba: It is doing HTML5 now, but when I clicked when the original posting was made it was doing Flash. I have flashblock installed so I have to click on a Flash item to get it to play which is how I can be sure. I’m running Chrome stable on Ubuntu Linux with Adobe’s Flash installed via their Ubuntu package.

    There was another Slideshare Flash presentation a few days ago that did the same thing to me. Pressing next/back would sometimes update the slide number and even rarer actually update the slide contents. Slideshare has worked correctly in the past.

Leave a Reply

Your email address will not be published. Required fields are marked *