Section 08

JavaScript, Part I

Famous Star Trek kissWe have discussed the structure web pages, we have covered the presentation of web pages, it’s now time to start thoroughly exploring how to give web pages functionality. We already investigated this aspect back in section 3, when we learned the art of making forms. But web page functionality goes much deeper than forms: Forms are great for collecting and sending data, but in order for us to dynamically manipulate the structure and presentation of our web page, forms can do little to help us.

Enter JavaScript, the heart of all web browser functionality. JavaScript, whether purists like it or not, is a programming language. And the first rule for fledgling web developers who are encountering JavaScript for the first time is “Don’t Panic!” We are not going to force you to learn how to program–indeed, an entire semester could be devoted to this–but we are going to show how to take advantage of other people’s programming efforts.

Nevertheless, it’s necessary to understand the basics, so we delve into the concept of variables, little boxes of computer memory that hold bits of information. We discuss writing statements, lines of text that tell a computer what to do with its variables. We show how we package up variables and statements into reusable functions. And, at last, we demonstrate how both variables and functions can be bundled together to form the core players of JavaScript: objects.

With this in mind, we present our final lesson of the day, one thing to remember above all else: JavaScript treats your web page as one gigantic object, an object that JavaScript can manipulate to its heart’s content. And by doing so, applications as complex as Google Docs are born.

Resources

Return to teaching home

  • You may use these HTML tags: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <strike> <strong>

Go to Top