background preloader

Javascript

Facebook Twitter

JavaScript Tutorial. Basic JavaScript | Java Script programming tutorial. Path // → → BASIC JAVASCRIPT JavaScript is a very easy way to add all sorts of dynamic elements to your site. Unless you've had some programming experience, JavaScript will be quite a new concept at the start — it's fairly different to HTML. In this tutorial we'll be laying some groundwork on the language, and writing our first script. This page was last updated on 2012-08-21 What is JavaScript? JavaScript is a simple scripting language invented specifically for use in web browsers to make websites more dynamic.

JavaScript is a client-side language, which means all the action occurs on the client's (reader's) side of things. JavaScripts are integrated into the browsing environment, which means they can get information about the browser and HTML page, and modify this information, thus changing how things are presented on your screen. Most importantly, JavaScript isn't overly tough to learn and use. Browser Compatibility Note: The Java Connection compiled first. Versions The DOM Implementation. JavaScript Part 1 - hello JavaScript. JavaScript Part 2 - The Free Stuff. JavaScript Part 3 - Prototype Based Lang. JavaScript Part 4 - the "this" operator. LINQ to JavaScript. Introduction to the Document Object Model. The Document Object Model, or DOM, is the interface that allows you to programmatically access and manipulate the contents of a web page (or document). It provides a structured, object-oriented representation of the individual elements and content in a page with methods for retrieving and setting the properties of those objects.

It also provides methods for adding and removing such objects, allowing you to create dynamic content. The DOM also provides an interface for dealing with events, allowing you to capture and respond to user or browser actions. This feature is briefly covered here but the details are saved for another article. DOM Levels and Support A short history lesson in order. For example, most browsers used an array of Image objects to represent all IMG tags on a page. Document.images[3].src = "graphics/button2.gif" These early models were limited. As vendors released new versions of browsers, they expanded on the model. Standards Compliant Browers The Document Tree Nodes. The DOM Event Model. Review the W3C DOM2 Event standard recommendation. One of the keys to creating dynamic web pages is the use of event handlers.

These allow you to execute specific script code in response to user or system initiated actions. Most events relate to the browser GUI, such as mouse movements, button or key clicks and updates to form inputs. These are usually tied to a specific page element. Others relate to browser actions such as when a document or image completes loading. Some objects have default actions defined for certain events, such as clicking on a hypertext link.

The browser's normal action in that event is to load the URL associated with the link. In any case, all events follow the same model. Browser Compatibility Some examples in this article will not work in Opera due to errors or lack of support in its CSS and DOM implementations. Assigning Event Handlers There are several ways to set up the capture of an event on an object using either HTML or scripting. HTML Tag Attributes. 20 Fresh JavaScript Data Visualization Libraries. There are plenty of JavaScript libraries out there for rendering your otherwise plain and boring numerical data into beautiful, interactive, and informative visualizations. The beauty of using JavaScript for data visualization is that, if created correctly, your data will be highly accessible (usually via HTML tables).

A long time ago (2008), I wrote about JavaScript solutions for graphing and charting data and this article revisits the topic with twenty more JavaScript libraries that you can use to bring your data to life. 1. Highcharts Highcharts is one of the most promising JavaScript charting libraries to hit the scene recently, with its large array of features including seven charting types (line, pie, and bar among them), the ability to zoom in and out of charts, and tooltips for offering more information about data points.

The library has many options for customization and they’re well documented on one page for easy referencing. 2. gRaphaël 3. 4. jQuery Visualize Plugin 5. moochart.

AJAX

jQuery.