background preloader

Javascript

Facebook Twitter

Code Playground. Create a new Fiddle - jsFiddle - Online Editor for the Web (JavaScript, MooTools, jQuery, Prototype, YUI, Glow and Dojo, HTML, CSS) JavaScript Lab - Tools - JS Regex Generator. <div class="note"> JavaScript is not enabled.

JavaScript Lab - Tools - JS Regex Generator

The regex generator is written completely for client side execution so you need to turn on JavaScript to use it. </div> First attempt at making a user-friendly regex generator. A little buggy in IE. Currently limited to 7 groups and no support for negating character classes. This script runs on top of JDC 1.0.3 in Internet Explorer which is why it is executed slightly faster in Firefox, Opera and Safari. For more info on regular expressions see Introduction to Regular Expressions using JavaScript. About code. Found at: This article will give you an introduction to the world of . I'll start off with explaining what regular expressions are and introduce it's syntax, then some examples with varying complexity and last a list of tools which use . Concept A is a text pattern consisting of a combination of alphanumeric characters and special characters known as metacharacters. A close relative is in fact the which are often used in file management.

You'll find that are used in three different ways: Regular text match, search and replace and splitting. Are often simply called regexps or RE, but for consistency I'll be referring to it with it's full name. Usage Now you're probably wondering why you should bother to learn . The Regulator. What the JavaScript RegExp API Got Wrong, &amp; How to Fix It. Over the last few years, I've occasionally commented on JavaScript's RegExp API, syntax, and behavior on the ES-Discuss mailing list.

What the JavaScript RegExp API Got Wrong, &amp; How to Fix It

Recently, JavaScript inventor Brendan Eich suggested that, in order to get more discussion going, I write up a list of regex changes to consider for future ECMAScript standards (or as he humorously put it, have my "95 [regex] theses nailed to the ES3 cathedral door"). I figured I'd give it a shot, but I'm going to split my response into a few parts. In this post, I'll be discussing issues with the current RegExp API and behavior. I'll be leaving aside new features that I'd like to see added, and merely suggesting ways to make existing capabilities better.

I'll discuss possible new features in a follow-up post. For a language as widely used as JavaScript, any realistic change proposal must strongly consider backward compatibility. Remove RegExp.prototype.lastIndex and replace it with an argument for start position. Jslibs - Project Hosting on Google Code. Jslibs is a standalone JavaScript development runtime environment for using JavaScript as a general-purpose scripting language. jslibs uses SpiderMonkey library that is Gecko's JavaScript engine (SpiderMonkey is used in various Mozilla products, including Firefox).

jslibs - Project Hosting on Google Code

The latest version of jslibs uses the new TraceMonkey/JaegerMonkey library with tracing/method JIT enabled. jslibs provides a set of native modules that contains various general purpose classes and functions. Présentation de Javascript (weebaz) Par Martin Depuis l’arrivée du web2.0 avec ses interfaces plus vivantes, le Javascript est de nouveau à la mode.

Présentation de Javascript (weebaz)

Souvent utilisé avec Ajax il permet d’ajouter une couche d’ergonomie supplémentaire à l’interface utilisateur. Javascript s’est « professionnalisé » ces dernières années, au travers de frameworks qui apportent leur simplicité et standardisent les développements. Fini donc les bouts de code que chacun bidouillait dans son coin, aujourd’hui Javascript permet beaucoup plus que cela, encore faut il en connaitre un minimum sur le sujet, c’est ce que nous allons voir. Photo de Frédéric de Villamil depuis Flickr Définitions Javascript ou JScript, suivant le navigateur, est un langage de script orienté objet ou plus exactement orienté prototype qui s’exécute côté client, sur la machine de l’internaute. Historique. JavaScript HTML DOM Examples.

RegExp

JavaScript Cookbook. JavaScript Kit- Array Object. By default sorts an array alphabetically and ascending.

JavaScript Kit- Array Object

By passing in an optional SortFunction, you can sort numerically and by other criteria as well. If SortFunction is defined, the array elements are sorted based on the relationship between each pair of elements within the array, "a" and "b", and your function's return value. The three possible return numbers are: <0 (less than 0), 0, or >0 (greater than 0): Less than 0: Sort "a" to be a lower index than "b" Zero: "a" and "b" should be considered equal, and no sorting performed.

Greater than 0: Sort "b" to be a lower index than "a". Take a look at the following 3 distinct examples: //Sort Alphabetically and ascending: var myarray=["Bob","Bully","Amy"] myarray.sort() //Array now becomes ["Amy", "Bob", "Bully"] //Sort Alphabetically and descending: var myarray=["Bob","Bully","Amy"] myarray.sort() myarray.reverse() //Array now becomes ["Bully", "Bob", "Amy"]