background preloader

Web Dev

Facebook Twitter

Performance JavaScript, des méthodes simples et efficaces. Dès que l'on part du principe que l'on code pour un navigateur, on se doit d'envisager différents cas de figure.

Performance JavaScript, des méthodes simples et efficaces

L'utilisateur peut posséder une machine puissante et une excellente connexion, tout comme il peut se trouver sur un ordinateur poussiéreux qui peine déjà à lancer son navigateur dans un vrombissement assourdissant. Pour cette raison, il est nécessaire d'être vigilant et de garder en tête que le script doit être le plus léger, rapide à initialiser et à exécuter possible. Ajoutons à cela un problème supplémentaire : chaque moteur de rendu possède sa manière de traiter le code, ce qui rend l'optimisation plus délicate. Cet article vous mentionnera quelques techniques simples et efficaces sur la majorité (ou la globalité) des navigateurs. Maintenabilité du code Votre source doit être compréhensible et lisible. Les règles à mon sens universelles à ce niveau sont : Globales vs locales Ainsi, myApp est accessible depuis des scripts externes.

Minifiez votre HTML en production Les bitwises. HTML5 Image uploader with Jcrop. HTML5 Image uploader with Jcrop We have received several inquiries for the last time from our readers with a question – how to upload photos to website.

HTML5 Image uploader with Jcrop

I think that this is an interesting question, and, I decided to lift the veil of this question. But, I think that the basic file upload is a bit boring thing, so, I decided to add an important feature – Cropping. It should be more attractive. Moreover, we are going to use HTML5 FileReader in order to perform cropping with Jcrop (jquery library) at client size. It is the very time to test our demo and download the sources: Live Demo download in package Step 1. Our first step is html markup. first, we have to put styles and scripts in the HEAD section: And now, in the BODY section we can put our form: I hope that all is clear at this step – this is usual upload form, with hidden and visible fields, once we have selected an image, we will see second step (crop). Step 2. Now, I would like to give you CSS styles to stylize our form: css/main.css. Is JavaScript the Future of Programming? Mashable Is JavaScript the Future of Programming? JavaScript is the programming language that makes a website interactive.

Is JavaScript the Future of Programming? Mashable Is JavaScript the Future of Programming?

Slideshows, advertising pop-ups and Google's autocomplete feature are all examples of JavaScript at work. It was first created by Brendan Eich at Netscape in 1995 — nicknamed Mocha during development, released in beta as LiveScript and ultimately named JavaScript in order to piggyback on the popularity of Java (another programming language) for marketing reasons.

At first, developers didn't take JavaScript seriously, because it wasn't seen as a serious development language like Java, Ruby or Python, which are server-side languages. JavaScript was the frosting on the cake, only responsible for user experience. But the language continues to become more prolific, often recommended as a first language to learn for beginners. Why JavaScript is Widely Used JavaScript is the only client-side scripting language. Also, since JavaScript Runs in a browser, you don't need to download software to use it. What JavaScript Can Do.