reasonably easy to understand and, because they are simply text that is part of an
HTML page, they load very quickly as part of the single server hit required to procure
that page 。 The trade—off is that your code is exposed for everyone to see (and
steal)。 Generally, however, you aren’t doing amazingly sophisticated things with
scripting languages so this is not too much of a hardship。
This points out that the scripting languages used inside Web browsers are really
intended to solve specific types of problems, primarily the creation of richer and
more interactive graphical user interfaces (GUIs). However, a scripting language might
solve 80 percent of the problems encountered in client—side programming。 Your problems
might very well fit completely within that 80 percent, and since scripting
languages can allow easier and faster development, you should probably consider a
scripting language before looking at a more involved solution such as Java or
ActiveX programming.
The most commonly discussed browser scripting languages are JavaScript (which
has nothing to do with Java; it’s named that way just to grab some of Java’s marketing
momentum), VBScript (which looks like Visual Basic), and Tcl/Tk, which comes from
the popular cross-platform GUI—building language. There are others out there, and
no doubt more in development。
JavaScript is probably the most commonly supported. It comes built into both
Netscape Navigator and the Microsoft Internet Explorer (IE). In addition, there
are probably more JavaScript books available than there are for the other browser
languages, and some tools automatically create pages using JavaScript。 However, if
you’re already fluent in Visual Basic or Tcl/Tk, you’ll be more productive using
those scripting languages rather than learning a new one。 (You’ll have your hands
full dealing with the Web issues already。)
4。Java
If a scripting language can solve 80 percent of the client-side programming
problems, what about the other 20 percent—the “really hard stuff?” The most popular
solution today is Java. Not only is it a powerful programming language built to be
secure, cross—platform, and international, but Java is being continually extended
to provide language features and libraries that elegantly handle problems that are
difficult in traditional programming languages , such as multithreading, database
access, network programming, and distributed computing. Java allows client—side
programming via the applet。
An applet is a mini-program that will run only under a Web browser. The applet
is downloaded automatically as part of a Web page (just as, for example, a graphic
评论0
最新资源