Advanced Javascript Tutorial With Examples
Advanced objects like Map and Set are useful data structures. Lesson 3: Advanced Functions We can use features of JavaScript functions to protect private state properties, organize our code, solve difficult challenges more elegantly, and build more flexible and reuseable tools. Large Collection of JavaScript source code. Choose from thousands of free scripts. JavaScript tutorials with example code. Excellent reference material for JavaScript.
Learning Speed In this tutorial, the learning speed is your choice. Everything is up to you. If you are struggling, take a break, or reread the material.
Always make sure you understand all the 'Try-it-Yourself' examples. JavaScript References W3Schools maintains a complete JavaScript reference, including all HTML and browser objects.
The reference contains examples for all properties and methods, and is continuously updated according to the latest web standards. JavaScript Quiz Test Test your JavaScript skills at W3Schools! JavaScript Exam - Get Your Diploma! W3Schools' Online Certification The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued! The documents your knowledge of HTML. The documents your knowledge of advanced CSS. The documents your knowledge of JavaScript and HTML DOM. The documents your knowledge of jQuery.
The documents your knowledge of PHP and SQL (MySQL). The documents your knowledge of XML, XML DOM and XSLT.
The documents your knowledge of the Bootstrap framework.
Script archive Advanced JavaScript Tutorials innerHTML Property Compatibility: Description: In IE the only way to create elements where to insert a html string that contained the markup needed for the element. This method is pretty limited but in conjunction with the W3C DOM it is really useful. It is even so powerful that the Mozilla engineers agreed to add the IE proprietary property, innerHTML, after a lot of demands from the developer community. The problem is that innerHTML can hardly survive on its own.
IE had other methods and properties to complement that but the Mozilla team decided not to include these. ScrollZoom Compatibility: Description: This is a sample of a new type of scroll bar that you can resize. If you ask yourself what resizing a scroll bar might mean you would probably agree that the logic meaning is that you are zooming.
If the scroll bars fill up the entire width the display area should as well. By dragging the bottom of the scroll bar up the display area should be zoomed but it should still be placed at the top of the window. Below is an image that can be zoomed and scrolled using the scroll bars below and to the right of it. Dock Bars Compatibility: Description: The first thing to do when combining scripts is to find the conflicts.
These are most often event handling conflicts but there could be name conflicts and other conflicts as well. IE5 has added a really nice solution that will remove the event handling conflict and this is done with a special method called attachEvent that takes two arguments. The first is the event name and the second is the function to call when the event occurs.
In IE4 (and Navigator) you have to create a special function that replaces the event handlers and this function then calls the separate event handlers. This is the method I'll use (so this will work in IE4). But first you need to include the scripts and set the variables for the dockbar. Cool Button Behavior Compatibility: Description: This behavior was based on the cool button script but it has been rewritten to use the power of DHTML behaviors.
Since I haven't explained much about behaviors before I think it is about time to do so now. If you don't want to read about how this behavior was made jump straight down to the demo section.
Behavior pros and cons The only real negative thing about behaviors is that it is an IE5 only technology but besides that it is all good. A very good thing about behaviors is that they are extremely easy to reuse and all you have to do is to add the behavior in the style declaration. Table Sorting Compatibility: Description: Maybe you've seen sortable tables before but it has probably been done using databinding in IE4.
Js Apps
Now it can be done using DOM level 1 (level 2 isn't finished yet) so it will work in both Internet Explorer 5 and Netscape Navigator 5 (NGLayout, Gecko). The actual sorting algorithm is the standard sort method of the javascript Array object so it is guarantied to be as fast as possible.
Object-Oriented Code
Read how this was made below or just see the demo or find out how you can use it yourself.