All posts tagged ‘thau’

File Under: JavaScript, Programming

Advanced JavaScript Tutorial – Lesson 4

In the previous lesson, we looked at the many different things you can do with text and strings. Today we’ll focus on two different types of data:images and objects. By the end of this lesson, you’ll know how to:

  • Use image maps with JavaScript
  • Preload images to speed up your image swaps
  • Create your own objects to make big scripts comprehensible
  • Use associative arrays to rapidly access all the objects in your scripts

We’ll get the ball rolling with image maps.

Continue Reading “Advanced JavaScript Tutorial – Lesson 4″ »
File Under: JavaScript, Programming

Advanced JavaScript Tutorial – Lesson 5

Wow – you made it to the last and final lesson! Stunning. As a reward for all your hard work, I’ve made this lesson extremely relaxing – no nitty-gritty code to wrap your mind around and no hairy homework, just coding theory and pointers to resources.

The topics for the day are:

  • Tools to help you write JavaScript
  • Debugging techniques
  • Tips for making your JavaScript code run quickly

Continue Reading “Advanced JavaScript Tutorial – Lesson 5″ »
File Under: JavaScript, Programming

JavaScript Tutorial – Lesson 2


In the last lesson, you learned about where JavaScript goes and how it looks. Now it’s time to start learning the language. In this lesson, you’ll learn how JavaScript stores information, how it makes decisions based on that information, and how to change images based on user interaction.

Ready? It’s time to learn the fundamentals of computer programming. First stop, variables.

Continue Reading “JavaScript Tutorial – Lesson 2″ »
File Under: JavaScript, Programming

JavaScript Tutorial – Lesson 3

In earlier lessons, you’ve learned:

  • How to add JavaScript to your HTML pages
  • How to use dialog boxes and variables to store and utilize user input
  • How to write HTML to a Web page using JavaScript
  • How to let JavaScript make decisions using if-then statements
  • How to make your Web pages react to users’ actions using link events
  • How to do a basic image swap

So far I’ve explained how to do many things, but I haven’t described why they work. In the last lesson, for instance, I showed you that window.document.monkey_image.src = "happy_monkey.gif" will swap happy_monkey.gif into an image named monkey_image . But what is that window.document stuff? And where does the .src come from? Similarly, you’ve seen document.writeln("monkey") . But why is it document.writeln and not just writeln ?

The answer to the above questions can be found in the JavaScript Document Object Model. The DOM is the way JavaScript describes Web pages, and it lies at the heart of all JavaScript programming. This lesson will teach you about the DOM, and the next lesson will teach you the rest of the basics of computer programming. By the end of the next two lessons, you will know all of the major ideas and syntax of JavaScript. All that will be left to learn are details, tricks, and how to avoid snafus.

To start us off along the road to the DOM, let’s learn about how to use JavaScript to open and manipulate new browser windows.
Continue Reading “JavaScript Tutorial – Lesson 3″ »

File Under: JavaScript, Programming

JavaScript Tutorial – Lesson 4

Welcome to Lesson 4! There are two main parts to JavaScript: the syntax of the language and its library of objects. In Lesson 2, which was an introduction to the syntax, we looked into variables, statements, and if-then clauses, which are parts of all programming languages. Now it’s time to learn the rest of the JavaScript syntax.

There are only three major aspects of JavaScript syntax that we have yet to cover: loops, arrays, and functions.

Let’s start with loops.
Continue Reading “JavaScript Tutorial – Lesson 4″ »