Chapter 11. Creating Custom JavaScript Objects
JavaScript is a wonderfully chaotic language. Some would say this is a good thing; others would say itâs the biggest detriment to its useâso much so that thereâs a move to a new version of JavaScript, JavaScript 2.0, in order to tighten up some of the languageâs looser aspects. Proponents of a newer version say itâs important to do so if JavaScript is to scale and be able to meet increasing demands.
After working with the previous examples, you might be scratching your head over the concept of JavaScript scaling. After all, the script tag is one of the most common found in web pages, and most sites use some form of JS. Any site that offers a shopping cart or other interactive element most likely uses JavaScript. Considering all of this, what could possibly be driving the concern about JavaScript and scaling?
The answer to that questionâcreating libraries of custom objectsâis the core of this chapter. The new interest in Ajax and a renewed interest in Dynamic HTML has led to a growing number of fairly large JS libraries and even larger web-based applications, so it appears that scaling really has become an issue of concern.
Or does it? After all, most of us arenât going to be creating Ajax-based replacements for Microsoft Word or Adobe Photoshop. Most of what we need are smaller libraries of objects that manage some of the more esoteric elements of Ajaxian server-side access or DHTMLâs more complex effects.
It is an ongoing ...
Get Learning JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.