background preloader

Javascript

Facebook Twitter

JavaScript FAQ, quizzes, games, and more.

API JS

JSON Editor Online - view, edit and format JSON online. RegExp. L'éditeur JavaScript - AJAX. Create HTML5 Canvas Drawing Board Within 5 Minutes! Welcome to “Create HTML5 Canvas Drawing Board Within 5 Minutes!”

Create HTML5 Canvas Drawing Board Within 5 Minutes!

Tutorial. We are going to create a drawing board using HTML5 Canvas API. This is an easy to follow tutorial, and I’ll try not to lose anyone, though, I promise. If you’re not entirely sure what HTML5 Canvas is, please read HTML5 Canvas For Absolute Beginners, before you continuing this tutorial. Please check out the demo before we start our tutorial. View Demo HTML Structure Ok, let’s start our tutorial by creating a div named “board” which will contains a canvas element and a color picker dropdown box.

CSS Styles The CSS for this tutorial is simple and easy, following is how the CSS codes looks like: First of all, we have to offset the body’s margin; horizontally center the div with named “board”; and apply 3px width of border to the canvas element. The JavaScript Here is the section where we convert our canvas into a drawing board. Next, we will have a window.onload event to executes all the codes when the window has loaded. Sylvester. L'XMLHttpRequest cross-domain - Javascript. Utilisation de jQuery.ajax() - Syrinxoon Tuts.

Suite à la demande d'un visiteur du site, je vais vous expliquer tout au long de ce tutoriel comment fonctionne la fonction jQuery.ajax() du framework jQuery et comment vous en servir.

Utilisation de jQuery.ajax() - Syrinxoon Tuts

Nous commencerons par l'aspect théorique à la base d'AJAX, à savoir, l'objet Javascript XMLHttpRequest. Si la théorie ne vous intéresse pas et que vous souhaitez passer tout de suite à la pratique, aucun problème, vous pouvez passer ce chapitre, je ne vous en voudrais pas, promis. Get OpenTok JavaScript API tutorials and sample code. Play HTML5 audio in the browser.

Google JavaScript Style Guide. We follow the C++ formatting rules in spirit, with the following additional clarifications.

Google JavaScript Style Guide

Curly Braces Because of implicit semicolon insertion, always start your curly braces on the same line as whatever they're opening. For example: if (something) { // ... } else { // ... } Array and Object Initializers Single-line array and object initializers are allowed when they fit on a line: Multiline array initializers and object initializers are indented 2 spaces, with the braces on their own line, just like blocks. Long identifiers or values present problems for aligned initialization lists, so always prefer non-aligned initialization. JS: The Right Way. JavaScript Fundamentals: Variables. I have never heard of a language that doesn't use variables, and JavaScript is definitely not an exception to that.

JavaScript Fundamentals: Variables

Variables are handled differently in each language and to become a true JavaScript expert you'll need to understand how JavaScript handles variables too. For the most part it's very straightforward, but there are plenty of "gotchas" you'll want to be aware of. JavaScript reference. JavaScript is a scripting language primarily used in Web applications.

JavaScript reference

It allows authors to create dynamic HTML (DHTML) pages. The JavaScript language has three components: Core JavaScript is the base part of the JavaScript language that is supported on both the client and server side. Client-side JavaScript (CSJS) contains the core JavaScript elements and has several additional objects, properties and methods that are supported by browsers. Server-side JavaScript (SSJS) also contains the core JavaScript elements and it has additional features supported by server-side products. Dottoro provides you a complete standard and browser specific Core and Client-side JavaScript reference with detailed descriptions, syntax, examples, browser support information, cross-browser solutions and much more.

JavaScript. Skill Level Indicator by apovtx. Welcome to Skill Level Indicator's GitHub Page.

Skill Level Indicator by apovtx

Skill Level Indicator is a javascript function that helps you create nice and highly customizable rounded skill indicators. It's usage is very simple. It only requires a browser that supports the html5 canvas element. See it in action: Usage After including the script in your page you only have to just call it with 1 mandatory argument and some optional changes you may want.

A Step-by-Step Tutorial of Building a Simple Peer-to-Peer WebSocket App – Part 1. This tutorial series walks you through the simple steps of building an HTML5 WebSocket app, demonstrating the power of the publish/subscribe development pattern directly in JavaScript.

A Step-by-Step Tutorial of Building a Simple Peer-to-Peer WebSocket App – Part 1

Our sample is almost as simple as a Chat app, the “Hello World” app of the WebSocket world, but is a tad more visual and dynamic. After trying out the completed application, you can either jump in the code and play with it right away, or move on to Part 2 of this tutorial for a step-by-step guide. About the Environment This tutorial requires a WebSocket server. We will use which hosts the JMS Edition of Kaazing WebSocket Gateway, Kaazing’s high-performance enterprise-grade WebSocket Server. Getting Started Firstly, to understand how the tutorial environment in JSFiddle works, open up the completed demo in JSFiddle.

Note: The sample code uses an HTML5 element, <input type=”range”> that is unfortunately not supported by every browser. In the bottom right pane, you can interact with the completed app.

Framework

390 ressources Javascript & jQuery. Learn to code.