dimanche 28 juillet 2013

JavaScript Tutorial - Table of contents

  • Introduction
    A brief introduction to the tutorial and what you can expect to learn.
  • Lesson 1: What is JavaScript?
    Learn about JavaScript, who created it, what JavaScript can and cannot do.
  • Lesson2: Your First JavaScript
    Learn how to include JavaScript in your web page, how to use comments in your code, and write your first JavaScript script.
  • Lesson 3: Events
    In the previous lesson you encountered the onload event and used it to check whether JavaScript was working in your browser. Here you learn what events are, why they are important to control your web page behavior with JavaScript, and which core events to look out for in your scripts.
  • Lesson 4: Variables and Constants
    A JavaScript program is mostly about processing data. Variables and constants are the building blocks of programming. In this lesson you will learn how to create variables and constants to store and manipulate your data.
  • Lesson 5: Smarter Scripts with Operators
    Every program, even the simplest one, contains some logic. In this lesson you will learn how to use mathematical, logical, and comparison operators to give some intelligence to your web page.
  • Lesson 6: Even Smarter Scripts with if…else and switch
    We’ll be looking at how you can instruct your web page to make choices on the basis of some given condition.
  • Lesson 7: Leave Boring Repetitive Stuff to JavaScript with Loops
    Loops can repeat parts of a script. In this lesson, we look at loops such as while and for.
  • Lesson 8: Package your JavaScript Code with Functions
    In previous lessons you applied core programming concepts to make your web page behave as you wanted to. You also used JavaScript built-in functions such as alert() and document.write(). Now you will learn to create your own functions to better organize your code.
  • Lesson 9: A Gentle Introduction to Objects
    Modern programming languages such as JavaScript, PHP, etc., all support a programming model called Object Oriented Programming (OOP). You’ve already used variables and constants to store your data; objects are just another way of storing data and of giving you more power to manipulate that data. You will be introduced to core JavaScript built-in objects in the following lessons.
  • Lesson 10: JavaScript Objects - Strings
    You’ve been using the string (text) object since the beginning of these lessons. Here for the first time you will learn how to exploit all its power as a JavaScript object.
  • Lesson 11: JavaScript Objects - Date Object
    Learn to use the Date object to work with dates and times dynamically. You will be able to get today’s date, learn how to set a specific date, and how to display the time on your web page.
  • Lesson 12: JavaScript Objects - Math Object
    Performing complex mathematical calculations with JavaScript is a breeze. You will be able to use the Math object to build a square root calculator application.
  • Lesson 13: JavaScript Objects - Arrays 
    In this lesson, you will learn what an array is, how it is used, and what it can do.
  • Lesson 14: JavaScript Living Space - the Browser Environment
    Your JavaScript code comes alive in the context of a browser. Learn more about how the JavaScript language conceptualizes its own environment.
  • Lesson 15: Useful Tasks (I) – Setting and Retrieving Cookies
    At this point you're ready to explore how JavaScript performs some real world tasks. Here is how you can set and retrieve cookies, that is, small text files that store visitors’ preferences for personalization purposes.
  • Lesson 16: Useful Tasks (II) – Form Validation
    Our second real world task is so widely known that couldn’t have been overlooked. Learn how to ensure website visitors fill out your form correctly.
  • Lesson 17: JavaScript Timing Events
    In this lesson you will learn how to write JavaScript code that executes after a certain time interval. As a practical application of this technique, think about those nice photo galleries where a photo fades out as the next one fades in at specified time intervals.
  • Lesson 18: Making AJAX Calls
    AJAX (Asynchronous JavaScript and XML) is the buzzword of 21st century web applications, and JavaScript is a big player. In this lesson you learn how to make your web page behave smoothly and responsively just like a desktop application.
  • Lesson 19: Short Introduction to jQuery
    No JavaScript course could be complete without at least an introduction to the most widely used JavaScript library of our time,jQuery. Learn how to include jQuery in your projects and start using it to easily access elements and events in your web page.
  • Lesson 20: Cool Animation Effects with jQuery
    Learn how easy it is to add bells and whistles to your web page with jQuery.
  • Lesson 21: Easy AJAX Calls with jQuery
    In lesson 18 you learned to make AJAX calls the hard way. In this lesson you are going to perform the same task the jQuery way, that is, the fast and simple way.

ASP Tutorial - Table of contents

PHP Tutorial - Table of contents


CSS Tutorial - Table of contents


Lesson 15: The final tips


Congratulations, you have now reached the final lesson.

So now I know everything?

You have learned a lot and you are now capable of making your own websites! However, what you have learned are the basics and there is still a lot more to be mastered. But you now have a good foundation from which to build on.
In this last lesson, you will get some final tips:
  • First, it is a good idea to maintain order and structure in your HTML documents. By posting well arranged documents you will not only show others your mastery of HTML but will also make it considerably easier for yourself to keep an overview.
  • Stick to the standards and validate your pages. This cannot be stressed enough: Always write clean XHTML, use a DTD and validate your pages on validator.w3c.org.
  • Give your page contents. Remember that HTML is a tool, which enables you to present information on the Internet, so make sure that there is information to present. Pretty pages may look nice but most people use the Internet to find information.
  • Avoid overloading your pages with heavy images and other fancy stuff you have found on the Internet. It slows down the loading of the page and could be confusing for visitors. Pages that take more than 20 seconds to load can lose up to 50% of their visitors.
  • Remember to add your website to search engines/directories so people other than your closest family can find and enjoy it. On the front page of all search engines, you will find a link to add new pages (The most important is Google, but there are also others likeDMOZYahooAltaVistaAlltheWeb and Lycos).
  • In this tutorial, you have learned to use Notepad, which is a simple and very easy to use editor, but perhaps you will find it helpful to use a more advanced editor which gives a better overview and more possibilities. You can find a summary and reviews of different editors on Download.com.

How do I learn more?

First of all, it is important that you continue to work and experiment with the things you have learned in this tutorial. Study other people's websites and if you find something you like see how it was made with "View Source" (Click "View" in the menu in your browser and choose "Source").
View source
Search the Internet for examples and articles on HTML. There are lots of websites with great contents on HTML.
Read and ask questions in the Forums. This is where you meet the real experts from whom you can learn a lot.
Last, but not least, you should - whenever you feel ready - continue learning CSS in our CSS Tutorial.
The only thing left is to wish you hours of fun with your new friend, HTML.
See you on the Internet :-)

Lesson 14: Web standards and validation


In this lesson, you will get a little more theoretical knowledge on HTML.

What more is there to know about HTML?

HTML can be coded in many different ways. And browsers can read HTML in just as many ways. You could say that HTML has many dialects. That is why some websites look different in different browsers.
There have been attempts to make a common standard of HTML through the World Wide Web Consortium (W3C) founded by Tim Berners-Lee (yep! the great guy who invented HTML). But it has been a long and tough road.
In the old days - when browsers where something you had to pay for - Netscape was the dominate browser. Back then, the most supported HTML standard where called 2.0 and later 3.2. But with a market share of over 90% Netscape did not have to - and did not - care much about common standards. On the contrary, Netscape invented their own strange elements, which did not function in other browsers.
For many years Microsoft almost completely ignored the Internet. After a while they took up the competition with Netscape and introduced a browser. The first versions of Microsoft's browser, Internet Explorer, were not any better than Netscape at supporting the HTML standards. But Microsoft chose to give away their browser for free (always a popular thing to do) and Internet Explorer soon became the most popular browser.
From version 4 and 5 Microsoft aimed to support more and more of the HTML standards from W3C. Netscape did not manage to develop a new version of their browser and continued to distribute the outdated version 4.
The rest is history. Today the HTML standards are called 4.01 and XHTML. Now it is Internet Explorer that has a market share of over 90%. Internet Explorer still has its own strange elements but it also supports the W3C HTML standards. And so do all of the other browsers, such as Mozilla, Opera and Netscape.
So, when you code HTML following the W3C standards, you make websites that can be seen in all browsers - both now and in the future. And luckily, what you have learned in this tutorial is a new and stricter and cleaner version of HTML called XHTML.

How do I tell which version is used?

With all the different types of HTML you need to tell the browser which "dialect" your HTML is in, in your case XHTML. To do that, you use a Document Type Declaration. The Document Type Declaration is always written in the top of the document:
Example 1:
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">

 <head>
 <title>Title</title>
 </head>

 <body>
 <p>text text</p>
 </body>

 </html>
 
 
Besides the Document Type Declaration (the first line in the example above), which tells the browser that you want to write XHTML, you also need to insert some extra information in the html tag with the two attributes xmlns and lang.
xmlns is short for "XML-Name-Space" and should always have the value http://www.w3.org/1999/xhtml. That is all you need to know. But if you have a big hunger for complicated knowledge you can read more about namespaces on W3C's website.
In the lang attribute you state which language the document is written in. For this the ISO 639 standard is used, which lists codes for all the languages in the world. In the example above the language are set to English ("en").
With a DTD the browser knows exactly how it should read and show your HTML. Hence, use the example above as template for all your future HTML documents.
The DTD is also important when you want to validate your pages.

Validate? Why and how should I do that?

Insert a DTD in your pages and you can always check your HTML for errors by using W3C's free validator.
To test this out, make a page and upload it to the Internet. Now, go to validator.w3.org and type the address (the URL) of your page and validate it. If your HTML is correct you will get a congratulations message. Otherwise you will get an error report telling you exactly what and where you have done something wrong. Make some errors on purpose to see what happens.
The validator is not just helpful to locate an error. Some browsers try to compensate for lack of skills among web developers by trying to fix errors in the HTML and showing the page as they guess it should look. With such browsers, you might never see an error in your own browser. However, other browsers might guess differently or not show the page at all. The validator can help you find errors you did not even know existed.
Always validate your pages to be sure they will always be shown correctly.

Lesson 13: Uploading pages

Lesson 13: Uploading pages

Until now, only you have had the satisfaction of viewing your pages. Now it is time for the rest of the world to see your masterpieces.

Is the world ready for that?

The world is ready - you soon will be too. To get your website on the internet, you just need some server space and a free FTP program.
If you have Internet access, you might already have some free server space for your website. Your server space will then probably be called something like http://home.provider.com/~usernumber. But you might need to activate it first. Read more about this in the papers from your Internet provider or on their support pages.
Another option is to get some free server space on the Internet. In the same way that you set up an e-mail account (at for example Hotmail), you can register for free server space on the Internet. Several companies offer such a service - among them000webhost.com (click "Order Now" under "Free Hosting") - it will only take a couple of minutes to register.
To have access to the server, you need to know the "Host Name" (For example, ftp.htmlnet.site50.net) and have your username and password ready.

Is that all I need?

To access the server and upload your pages, you also need an FTP program. FTP is short for File Transfer Protocol. A FTP program is used to connect two computers over the Internet so that you can transfer files from your computer to another computer (the server). You might not have such a program yet, but fortunately, this can be downloaded for free.
There are many different FTP programs. One of the better is FileZilla, which is entirely free. So now you can download FileZilla at filezilla.sourceforge.net.

And how do I upload the pages?

Described below is how you upload your pages to a free account at 000webhost.com with FileZilla. But the procedure is, more or less, the same for all providers and FTP programs.
Open the FTP program while connected to the Internet. Insert "Host Name" ("ftp.htmlnet.site50.net" under "Address"), username (under "User") and password (under "Password") and click "Connect". You should now have access to the server. In one side of the program you can see the contents of your computer ("Local Site"), and in the other side, you can see the content of the server ("Remote Site"):
FileZilla
Find your HTML documents and images on your computer (on the "Local site") and transfer them to the server (the "Remote site") by double clicking on them. Now the whole world can see them! (For example, at the address http://htmlnet.site50.net/page1.htm).
Name one of the pages "index.htm" (or "index.html") and it will automatically become the start page. i.e. if you type http://htmlnet.site50.net (without any filename) you will actually open http://htmlnet.site50.net/index.htm.
In the long run, it might be a good idea to purchase your own domain (for example www.your-name.com or www.your-name.net) and avoid the long and complicated addresses you are being assigned by your Internet provider or from providers of free server space. You can find and purchase domains at for example Speednames or NetworkSolutions.