JavaScript
  Home arrow JavaScript arrow Object-Oriented JavaScript: An Introductio...
Web Buyers Guide
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Download TestComplete 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Web Buyers Guide
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Object-Oriented JavaScript: An Introduction to Core Concepts
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 19
    2005-11-28

    Table of Contents:
  • Object-Oriented JavaScript: An Introduction to Core Concepts
  • Working with objects in JavaScript : introducing the key concepts
  • Coupling methods to objects: defining self-contained constructors
  • Functions and objects: a closer look at the “Function” object
  • Getting information about objects: looking at the “constructor” property

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Anyone looking for a way to modernize legacy data or easily migrate to a more cost-effective database without sacrificing functionality will benefit from this seminar. View the Intro to Advantage Database Server now!

    Object-Oriented JavaScript: An Introduction to Core Concepts
    (Page 1 of 5 )

    JavaScript is a powerful object-oriented language whose capability has frequently been underestimated when compared with other OO languages. This article, the first of several parts, should help you gain a better understanding of JavaScript's true value. It will show you the basics of creating custom objects and defining their methods and properties. You will also learn some advanced concepts such as Inheritance. Plenty of real-world examples will be included.

    Introduction

    For the average JavaScript programmer, working with native objects exposed by this language is more than enough to meet the requirements of frequent programming tasks. Definitely, JavaScript is a powerful object-oriented language, which has suffered for a long time from a certain amount of underestimation when being compared to other full-blown object-based languages. After all, for years it’s been the best solution for performing client-side validation, working with rollovers, using pop-up windows, and other flashy stuff. Overall, there has been a misconception that JavaScript isn’t well suited for doing “serious” programming things. 

    True to form, JavaScript is an object-based language, but actually lacks certain features found in powerful languages such as Java or C++. However, to be fair, it offers some handy capabilities for creating custom objects. In many cases, these can be more useful than using traditional functions. This is particularly true when hiding complex functionality behind an object’s API implies a better approach to solve specific programming issues. To cite a good example, just spend a few minutes looking at the API of “GoogleMaps” objects, and probably you’ll realize what I’m talking about.

    Considering that large JavaScript applications can actually have a remarkable impact in utilizing user-defined objects, as well as in encouraging code reusability, in this article I’ll show you the basics of how to create custom objects, define their methods and properties, together with some advanced concepts such as Inheritance. Of course, I won’t leave you to digest the boring theory all by itself without spicing up things with some real-world examples, so you can use them as part of your JavaScript programs.

    Now that I’ve hopefully caught your curiosity about learning how to write object-oriented JavaScript, it’s time to move on and start grasping the basic concepts. Let’s get going!

    More JavaScript Articles
    More By Alejandro Gervasio


       · This firt tutorial introduces the core concepts for creating user-defined objects in...
       · I was suprissed to see that the wrong way is still used. The correct way to OO in...
       · Thank you for commenting on my JavaScript article.Actually, the method for...
       · Hi, I've been using objects in JavaScript for quite a long time and it was always...
       · Thank you so much for the positive comments, since they're very useful....
       · Maybe it's because it's IE, but when I copied and pasted the code:function...
       · Hello,Thank you for your comments on this article. Regarding your question, I've...
     

    JAVASCRIPT ARTICLES

    - A Closer Look at Smart Markers with Yahoo! M...
    - Using Polylines and Smart Markers with Yahoo...
    - Bulleted Menu of Links
    - Creating Click Loggers and Basic Markers wit...
    - Adding Pan Controls to Yahoo! Maps
    - Adding Zoom Controls to Yahoo! Maps
    - Working with Yahoo! Maps
    - Building Image Zooming Controls with the DOM...
    - Working with Multiple Graphics for a Zoom Ap...
    - Improving an Image Zooming Application with ...
    - Zooming in on Images with JavaScript
    - JavaScript Date Objects: Universal Coordinat...
    - Javascript Objects: More Date Methods
    - JavaScript Objects: Dates
    - JavaScript Objects: Finishing Strings

    Iron Speed

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway