Learn java scripts, Javascripts, Java, Java with examples.

Earn Money for free

Tuesday, May 27, 2008

JavaScript's Place in Navigator 2.0

JavaScript's Place in Navigator 2.0

JavaScript is one of the least-used components of Netscape's suite of interactivity tools (although that is quickly changing), but it could be the most significant. Not only does it bring interactive programming within the reach of the average Web author with no formal programming experience, it can also be used to move much of the processing away from over-burdened servers to increasingly-powerful client workstations

question and answers

Q: I've only used visual programming tools for making Web pages, can I learn JavaScript? How will knowing JavaScript make my home page better?

A: While it's true that programming in JavaScript is more similar to programming in C than using a visual programming tool, most JavaScript programming is simple enough to make it easy for the complete beginner.

In addition, the development of interfaces to JavaScript programs almost entirely involves the use of HTML and HTML forms, which can be developed in a visual environment using several HTML development tools, including Navigator Gold from Netscape.

If you learn JavaScript, you will be able to add interactivity to Web pages. For instance, if a user enters data in a form, a result can be calculated and displayed for the user. Similarly, if the user moves the mouse over a link or button, help information can be displayed in the status bar of the Navigator window.

Q: I want to add interactivity to my Web pages. Should I learn Java or JavaScript?

A: Java and JavaScript are not competitors. They are complementary programming languages which both extend the functionality of Web browsers—in this case Navigator 2.0.

You will find that Java is suited to a different set of tasks than JavaScript. For instance, a viewing tool for CAD documents would need to be developed using Java applets while an interactive HTML form could only really be developed using JavaScript.

Where Does JavaScript Fit In

Where Does JavaScript Fit In?

Navigator 2.0 is the most powerful version of Netscape's Web browser. Besides bringing together a collection of useful Internet-access tools, such as a mail client, a news reader, and improved support for the developing HTML 3 standard, Navigator 2.0 adds several features that enhance the ability of Web authors to develop complete, platform-independent applications deployed and executed in the Netscape browser. Going beyond the Web browser, Navigator Gold adds editing and development tools to the package.

These capabilities include an applications programmer's interface (API) for plug-ins. Plug-ins are program modules that dynamically extend the capability of Navigator 2.0 to handle new types of data and information, along with JavaScript and Java, which allow the addition of flexible progammability to Web pages.

In this chapter we also take a detailed look at the main features and aspects of JavaScript, as well as review the major strengths and weaknesses of the JavaScript language and its suitability to particular tasks.

We then dive deeper into objects and how they work and take a look at properties and methods—the building blocks of objects. We also look at the built-in objects in JavaScript and what they offer the programmer.

In this chapter we take a broad look at Navigator 2.0 and consider how JavaScript fits into the puzzle. You'll learn about the following topics:

  • Frames: The ability to divide a window into multiple, independent sections

  • Plug-ins: Third party add-ons for Navigator 2.0 that extend the browser's ability to handle new data and information

  • Java: An object-oriented programming language for distributed applications

  • JavaScript: A simple, object-based programming language incorporated into Navigator 2.0 (and the subject of this book)

  • The similarities and differences between Java and JavaScript

  • JavaScript as a scripting language

  • Objects, properties, and methods

  • The Navigator object hierarchy and other built-in objects

  • Strengths and weaknesses of JavaScript