background preloader

jQuery Core

Facebook Twitter

Outils pour construire un code jQuery évolutif. (4) Je cite4 : "Un espace de noms est une notion permettant de lever une ambiguïté sur des termes qui pourraient être homonymes sans cela.

Outils pour construire un code jQuery évolutif.

Apprendre et comprendre jQuery – 1/3. Tutoriels jQuery Introduction rapide et en douceur à l’utilisation d’une des bibliothèques JS à la mode.

Apprendre et comprendre jQuery – 1/3

Ou comment ajouter une couche d’interactions simplement et proprement à vos pages. NB : ce billet sera divisé en trois parties. Publié il y a déjà trop longtemps… Introduction jQuery est une bibliothèque JS développée principalement par John Resig. Par bibliothèque on entend donc un ensemble cohérent de fonctions permettant de s’affranchir des tâches rébarbatives et répétitives de façon uniforme sur les navigateurs les plus courants. Elle est sous licence GPL et MIT, et donc complètement réutilisable sur des travaux professionnels. Les navigateurs supportés sont : Apprendre et comprendre jQuery – 3/3. jQuery permet de créer en quelques lignes des requêtes AJAX sans se soucier de l’inter-compatitibilité des navigateurs.

Apprendre et comprendre jQuery – 3/3

Également, à l’aide de paramètres simples, il est possible de personnaliser le formatage de ses requêtes. La méthode $.ajax() Fonction de base Cette fonction est sûrement celle que vous utiliserez le plus avec jQuery. Déterminez les trois paramètres de base : la méthode utilisée (POST ou GET), l’URL de la page appelée et l’action à effectuer. Requête sur un lien Généralement, on utilise des requêtes AJAX sur des liens hypertextes (balise <a>) afin d’avoir des pages tout de même accessible si le Javascript est désactivé. Dans cet exemple, lorsque l’on clique sur un lien possédant la classe CSS test, le code HTML de la page liée s’affiche dans la balise possédant l’id recipient. Requête sur un formulaire De la même façon, on peut envoyer un formulaire en AJAX lors de sa soumission :

Advanced jQuery, for those that dare. Authored by James Padolsey Reviewed by [?] (this "book" is unfinished... enjoy!) Last updated: 29-March-2010 Copyright © James Padolsey Creative Commons Attribution-NonCommercial-ShareAlike 3.0 unported license. You are free to remix, tweak, and build upon this work non-commercially, as long as you credit James Padolsey (the copyright holder) and license your new creations under the identical terms. Introduction Blah blah blah, introduction... This short book has been written to demonstrate, discuss and divulge the stengths of jQuery and its companions, the DOM and of course, JavaScript itself. My name is James Padolsey, and I hope this book can teach you some valuable things, and at the very least, plant seeds of curiousity that will later drive you to discover new things.

jQuery Event Binding to a Prototypical Instance. Posted: Tuesday April 10, 2012 Tagged with: jQuery javascript jQuery is a powerful framework designed to take the pain out of writing cross-platform Javascript and 99% of the cases it does so extremely successfully.

jQuery Event Binding to a Prototypical Instance

There are however certain instances where you want to do something that's a little bit of a fringe case and you're left scratching your head. The only way to get past the roadblock is to take a deep breath and dive into the source code, which thanks to jQuery's open source nature is actually an awesome thing to be able to do. In this particular instance I was trying to bind a custom event to an instance of a prototype. Let's rewind a bit. $( '#SomeID' ).on( 'click', function(){…} ); The above snippet is the simplest of event bindings with jQuery.

jQuery in it's greatness takes events one step further and allows the binding of custom events. 5 Different Ways to Declare Functions in jQuery. Introduction Choosing which way to declare a JavaScript function can be confusing for beginners as there are several different ways to declare functions using JavaScript/jQuery.

5 Different Ways to Declare Functions in jQuery

I’ll try to explain the benefits of each one and how and why you might use them when writing your awesome jQuery code. 1. The basic JavaScript function This is the simplest way to declare a function in JavaScript. Function multiply(x,y) { return (x * y);} console.log(multiply(2,2));//output: 4 If you wanted a quick function to test something then maybe that’s the only occasion you would use this. 2. If you need a private utility for getting/setting/deleting model values then you can declare a function as a variable like this. jQuery - VisionFriendly.com – Development. In this episode, we have a very brief introduction to the main object through which all jQuery-ing will be done: The $ object.

jQuery - VisionFriendly.com – Development

The main point of this part is for you to get accustomed to looking at jQuery code and its syntax, styles, and idioms. Don't worry about understanding or memorizing the code. The $ object is the global object through which all jQuery core (and plugin) functionality is accessed. Just like any other object in object-oriented programming, it has properties (akin to the length of an array) and it has methods (akin to calling document.write() or Array.length()). Having an object named $ may seem a little weird, but don't get distracted by it.