Scripting Options in Internet Explorer

Internet Explorer natively supports two scripting languages, Microsoft Visual Basic Scripting Edition (VBScript) and a Microsoft version of JavaScript, called JScript.

Internet Explorer is also a scripting host—that is, support for other scripting languages, such as Perl, can be added. This hosting capability lets developers use scripting languages with which they are already comfortable directly inside Internet Explorer, without having to learn another language. It also allows them to use scripts previously written in one of these other languages in Internet Explorer without having to rewrite the scripts in another language. This is especially handy on the server side and when using Internet Explorer to develop tools that will be used on a limited number of machines that all have the requisite scripting engine installed. This book does not discuss script language hosting in depth, but the SBN Workshop Web site and the CD that accompanies this book are good resources on this subject.

NOTE
Perl is a mature scripting language that is popular on UNIX systems. It is supported as both a stand-alone and Web server scripting system on a wide variety of platforms, including all 32-bit versions of Windows. No major browser currently ships with built-in support on the client side for Perl. More information about Perl can be found at www.activestate.com and www.perl.com.

VBScript

VBScript is a relative of Microsoft's popular Visual Basic programming language. Internet Explorer is the only browser that currently supports VBScript, although the language is supported on the Web server side by Microsoft Internet Information Server (IIS) with Active Server Pages (ASP). VBScript is attractive to programmers who are already familiar with Visual Basic because many of the constructs and the syntax in both languages are the same (or at least quite similar), which makes VBScript easy to learn.

In Internet Explorer 5, VBScript is not included with a minimal installation of the browser, although it is automatically downloaded when needed from the Internet. Additionally, as mentioned earlier, VBScript is not currently supported in any browser other than Internet Explorer. Because of this, the scripting samples in this book use JScript to enable them to function in other browsers.

JavaScript and JScript

Although its name might imply that JavaScript is a subset of Java, it is not. JavaScript is a completely separate language from Java that was developed by a different company. (Java was developed by Sun Microsystems; JavaScript was originated by Netscape Communications.) Despite the differences, however, JavaScript does share some constructs and syntax with its namesake. Java developers will recognize hints of the Java language in JavaScript, and although JavaScript is not quite as forgiving as VBScript, even novices will find it relatively straightforward to learn and use. (In fact, experienced script writers often prefer JavaScript for its more rigid syntax compared to VBScript.)

JScript is the version of JavaScript that is part of Internet Explorer. In most respects, JScript is exactly the same as JavaScript. JavaScript and JScript evolved over time, resulting in some incompatibilities between browsers and browser versions. The European Computer Manufacturer's Association produced a standard (ECMAScript or ECMA-262), encompassing the core features of JavaScript and JScript. Internet Explorer versions 4 and later and Netscape Navigator versions 4.06 and later support ECMA-262, although each support some extra functionality. We will be using JScript for the scripting examples in this book. Like the other scripting languages listed above, JScript/JavaScript is supported on many Web servers.

NOTE
On the SBN Workshop Web site and on the CD that accompanies this book is a useful JScript reference that will be mentioned frequently in upcoming chapters. For another online reference, check out the JScript section of the Microsoft Web site at msdn.microsoft.com/scripting.



Dynamic HTML in Action
Dynamic HTML in Action
ISBN: 0735605637
EAN: 2147483647
Year: 1999
Pages: 128

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net