background preloader

JavaScript : 3 fondamentaux

JavaScript : 3 fondamentaux
Après quelques années à écrire dans un langage, on finit facilement par oublier les premières difficultés que l’on avait rencontrées. Et à force de faire de la veille, de l’autoformation et de parler entre experts dans des conférences, j’ai un peu quitté la réalité de la majorité des équipes Web. Maintenant que je suis consultant indépendant je retourne dans des équipes qui avaient autre chose à faire que de se demander si on a le droit de parler de classe en JavaScript, quelle est la bonne définition d’une closure, ou quelles sont les fonctionnalités de EcmaScript 5 qui auraient du rester dans Ecmascript.Next. J’avais déjà parlé sur ce blog de JavaScript et la programmation orienté objet pour les développeurs PHP, nous allons explorer ici les 3 notions fondamentales de JavaScript qui sont probablement les plus grosses sources de bugs, d’incompréhension et de frustration pour le développeur Web moyen. Et qui accessoirement sont la base d’une programmation plus évoluée par la suite.

Announcing Amber.js « Katz Got Your Tongue? - Vimperator December 8th, 2011 A little over a year ago, I got my first serious glimpse at SproutCore, the JavaScript framework Apple used to build MobileMe (now iCloud). At the time, I had worked extensively with jQuery and Rails on client-side projects, and I had never found the arguments for the “solutions for big apps” very compelling. When I first started to play with SproutCore, I realized that the bindings and computed properties were what gave it its real power. But even before I got involved in SproutCore, I had an epiphany one day when playing with Mustache.js. Not wanting to build an observer library in isolation (and believing that jQuery’s data support would work in a pinch), I started working on the first problem: building a template engine powerful enough to build automatically updating templates. After some months of retooling SproutCore with Tom Dale to take advantage of an auto-updating templating solution that fit cleanly into SproutCore’s binding model, we reached a crossroads.

FGRibreau/forever-webui - GitHub Memory leak patterns in JavaScript JavaScript is a powerful scripting language used to add dynamic content to Web pages. It is especially beneficial for everyday tasks such as password validation and creating dynamic menu components. While JavaScript is easy to learn and write, it is prone to memory leaks in certain browsers. In this introductory article we explain what causes memory leaks in JavaScript, demonstrate some of the common memory leak patterns to watch out for, and show you how to work around them. Note that the article assumes you are familiar with using JavaScript and DOM elements to develop Web applications. Memory leaks in JavaScript JavaScript is a garbage collected language, meaning that memory is allocated to objects upon their creation and reclaimed by the browser when there are no more references to them. Internet Explorer and Mozilla Firefox are two browsers that use reference counting to handle memory for DOM objects. What's wrong with circular references? Listing 1. Another memory leak pattern

A Look at Popcorn Today we’re going to take a look at Popcorn.JS, a library from Mozilla which makes it very easy to manipulate a webpage based on the current position of a video. This allows you to create rich “hypermedia” experiences around your video content. With Popcorn, you could display information about actors currently on-screen, or show Google Street View maps of locations in the video. Take a look at the Demo Page to see what we’ll be achieving – a mix of images, Google Maps, Wikipedia, tagging, RSS feeds, Facebook and web content – all in a 22 second video clip. About Popcorn Popcorn makes video work like the web. Popcorn provides a collection of plugins to easily pull in remote data to the screen. This pulls in the first 40 words from the Queen’s Wikipedia page into the element with an ID of wiki. You can just as easily display a Google Map: This displays a Google Map of England in #map at 10 seconds, and disappears at 12. Getting Started Create your file structure like so: Images Videos Done it?

Top 10 Useful JavaScript Libraries for Developers A JavaScript library is a library of pre-written JavaScript which allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. JavaScript library is mostly used for writing functions that are embedded in or included from HTML pages and interact with the Document Object Model (DOM) of the page. Because JavaScript code can run locally in a user’s browser (rather than on a remote server), the browser can respond to user actions quickly, making an application more responsive. Here at STG we have compiled Top 10 useful and innovative JavaScript Libraries which will surely enhance and improve one’s Web experience whether you are a Developer or regular web-user. If you like the article you might be interested in our other article on 6 Web Enhancing JavaScript Libraries for Developers and Top 5 WebDev Enhancing jQuery Scripts. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Enjoyed this post?

Adding a JavaScript-based diff « Glen Smith Posted by Glen on Mar 17, 2011 in Grails, Groovy | 3 comments I’ve been on the hunt lately for some JavaScript based diffing routines.I’ve had a look at a few of them, and the one I’ve settled on is google-diff-match-patch which they use in the Grails wiki! (Thanks Peter Ledbrook for the pointer!) My particular need was around diffing a fairly complex “tree” structure. These tree structures are actually imported from files that 3rd party releases from time to time and client import them directly into our product (it’s not always easy to see what’s changed between the versions they release – hence the need for a quick “visual diff” solution. Here’s an example of the one of these control libraries (the Australian ISM) being diffed (notice the token changes I’ve hacked into the version on the right): What I really like about google-diff-match-patch is that the API is very simple, and comes in a single JS file with no dependencies. Loving the new diff feature!

Lets Make a 3D Game: microphysics.js This post is part of the “Lets make a 3D game” series. 3D and physics simulation always go well together evenmoresowithmarblegames. One is required for marblesoccer but i wasnt convinced by current 3d physics engines. I explain why at the end. It is bite-sized, elegant and efficient. Below is a screencast of me doing a short introduction of the playground. Let’s get started So lets see how to use it. Let’s Create a World Quite a title hey ? Now you start it. The world is now fully initialized. The timeStep parameter is the precision of the physics engine, expressed in seconds. Let’s Add Bodies Don’t worry, this is not about killing people and dispose of their dead bodies :) In physics, A body is a solid object that you put in your world. microphysics bodies can be spheres or static boxes. This will position it at (10,10,10) in the world. restitution will determine how bouncy is this during a collision. Now lets add it to our world If you need to remove it, just do world.remove(sphere).

10 Impressive JavaScript Animation Frameworks Complex and slick JavaScript-based animation has been made easier with the emergence of frameworks and libraries that give developers the ability to create stunning and eye-grabbing animation and transition effects that make it easy these complex tasks. In this article, you will read about the top 10 JavaScript-based animation frameworks and libraries that will enable you to create engaging and captivating user experiences. 1. $fx $fx is a compact and lightweight JavaScript animation library which extends native JavaScript DOM methods with its own animation methods and functions. Its small file size (weighing in at only 3.7 KB), hassle-free implementation, and low learning curve makes $fx a powerful option for adding eye-popping animation effects to your web projects. 2. jsAnim Created by web developer Kevin Dolan, jsAnim is a JavaScript animation framework for creating high-impact and slick animation sequences for web interfaces. 3. scripty2 5. 6. 7. 8. 9. 10. Related content

Related: