
June 24th, 2003, 05:32 PM
|
 |
junior vice president
|
|
Join Date: Jan 2002
Location: Springfield
Posts: 251
Time spent in forums: < 1 sec
Reputation Power: 7
|
|
|
ref.
Here's a pretty definitive (hehe... pun INTENDED!) explaination to your question:
Quote: JavaScript is a new technology that is rapidly changing. It is not yet well understood and is the subject of
a fair bit of misinformation and confusion. Before we proceed any further with our exploration of
JavaScript, it is important to debunk some common myths about the language.
One of the most common misconceptions about JavaScript is that it is a "simplified version" of Java, the
programming language from Sun Microsystems. Other than an incomplete syntactic resemblance and the
fact that both Java and JavaScript can deliver "executable content" over networks, the two languages are
entirely unrelated. The similarity of names is purely a marketing ploy (the language was originally called
LiveScript, and its name was changed to JavaScript at the last minute).
JavaScript and Java do, however, make a good team. The two languages have disjoint sets of capabilities.
JavaScript can control browser behavior and content but cannot draw graphics or perform networking.
Java has no control over the browser as a whole, but can do graphics, networking, and multithreading. In
Navigator version 3.0, JavaScript can communicate with the Java interpreter built into the browser and
can work with and control any Java applets in a web page. This means that in this version of Navigator,
JavaScript really can "script" Java. This new feature is called LiveConnect, and it also allows Java code
to invoke JavaScript commands. Chapter 19, LiveConnect: JavaScript and Java describes LiveConnect
in detail.
JavaScript is touted as a "scripting language" instead of a "programming language," the implication being
that scripting languages are simpler, that they are programming languages for nonprogrammers. Indeed,
JavaScript appears at first glance to be a fairly simple language, perhaps of the same complexity as
BASIC. Further experience with JavaScript, however, reveals complexities that are not readily apparent.
For example, the use of objects as arguments to functions requires a careful understanding of the
difference between passing arguments "by value" and passing arguments "by reference." There are also a
number of tricky details to understand about converting data values from one type to another in
JavaScript. Even the seemingly simple document.write() method has nonintuitive aspects.
Quoted from O'Reilly, Javascript the Definitive Guide |
Nao
|