spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column80


Object-Oriented Programming with JavaScript, Part II: Methods

Developer News
iPhone Users Just Want to Have Fun
Oops! I Fixed the Linux Kernel
Jim Zemlin: The New Center of Linux Gravity

In this column we conclude our short series about Object-Oriented Programming (00P) with JavaScript. In Part I of this series, we covered the fundamentals. In this column, we focus more on encapsulation, especially on methods.

As we discussed in the first part of this series, JavaScript's support of object-oriented programming is quite impressive. Even though there are no formal classes or instances, there are objects, prototypes, and methods that mimic them. In fact, it is the methods that make the language so vibrant and powerful. You use methods to mimic class inheritance between objects. We'll show you how to define functions in JavaScript, and how to define methods with these functions. We'll show you where method definition does not match the rules for functions. We'll explain the exposure of private data elements, and how to protect them. In this column, we also cover contexts, scopes, and context switching. Understanding contexts and scopes will help you in writing as well as debugging complex scripts.

The examples in this column are for JavaScript 1.1 and above, for both Internet Explorer and Netscape, unless noted otherwise.

In this column, you will learn:

Next: How to construct an object from the Object object

More Resources from Doc JavaScript
Columns Popular Columns Tips Tools
Latest Columns
41-50 | 31-40 | 21-30
11-20 | 1-10
Working with Windows
JavaScript and Frames
Bookmarklets
Random Tips
Personalized Tips
RSS Channels
Menu Builder
Rollover Builder
Rotation Builder
Reference Tip Categories (want one?)
Links
For Your Site
Did you learn something? Do you like this site? Please link to us!

http://www.internet.com



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Performance Optimizations for High Speed JavaScript · Advanced Web Performance Optimization · Simple Comments Meets OpenID
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Installing Oracle E-Business Suite R12 on Windows 2003 · When the Cloud Storms on You · eBay Watch: DSR 4.3 Tips, Tactics and Seller POV


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: March 26, 2001
Revised: March 26, 2001

URL: http://www.webreference.com/js/column80/index.html