![]() |
|||||
|
|
JavaScriptJavaScript is a comparatively easy-to-use scripting language that can be embedded in your web pages. It can enhance the dynamic and interactive features of your page by allowing you to perform calculations, check forms, write interactive games, add special effects, customise graphics selections, create security passwords and more.Learning Objectives
Requirements: A JavaScript compatible browser. (Netscape Navigator 2.0 or greater and Microsoft Internet Explorer 3.0 or greater) A word about Browser supportAt the moment JavaScript is supported by a good range of browsers. Netscape Navigator 2.0 and greater and Microsoft Internet Explorer 3.0 and greater are, between them, by far the most used browsers and they all support JavaScript. Unfortunately their implementation varies.Efforts are being made to standardise browser scripting with the ECMA script standard. The problem is that both Netscape and Microsoft claim that their browsers conform to the standard, they just do it in different ways. This module aims to convey the fundamentals of the JavaScript language and to do that it needs to avoid getting side-tracked by implementation issues. To handle these issues you first need a good understanding of the JavaScript language. For now just be aware that writing JavaScript code for more than one browser is not a straightforward matter. So the reason that the word Gateway is used is because CGI defines the gateway between the server and the helper programs that reside on the server. HistoryBefore JavaScriptThe HTML language, used to create pages for the World Wide Web, was originally designed to produce plain, static documents for academic and scientific use. Originally the only Web browsers were text based and HTML was sufficient. Mosaic was the first graphical browser. When Mosaic was released the concept of what the Web could do was dramatically changed. Developers and users both started demanding more enhancements to what a browser could do. Designers wanted control over colour, tables and images. Businesses wanted intelligent forms and secure pages. Everybody wanted the new buzzword, "interactivity". JavaScript is Born At the same time interest was building in a language originally designed for household appliances, such as microwaves and washing machines, and which was now being used on the Web. Java, developed by Sun Microsystems. In a act of mutual back scratching, unusual in Internet technology development, Netscape decided to support Java in Navigator 2.0 and, in exchange, Sun decided to help Netscape re-design LiveScript and re-name it JavaScript. The prime creators of JavaScript were Brendan Eich from Netscape and Bill Joy from Sun. What's the difference between JavaScript and Java?Java is a compiled programming language (technically it is semi-compiled but we won't go into that). It is powerful enough to write major applications and these applications can be embedded within a web page as Applets. You cannot see the Java code of an Applet by looking at the source of the HTML page.Java is cross-platform, meaning that the same Java program can run on any hardware platform (on IBM, Mac, and UNIX computers for example). Java is not an easy language for non-programmers. In contrast to Java, JavaScript is an easy-to-use scripting language. JavaScript has an easier learning curve than Java and can be used to add interactivity to Web pages with little effort. JavaScript is an interpreted language. In the case of JavaScript this means that it has to run within a browser. It is written directly into a page of HTML. If you view the source of a JavaScript enhanced page of HTML you will be able to read (and "borrow") the JavaScript code. On the negative side, JavaScript is not as powerful as Java. Java and JavaScript can work together Another aspect of this sharing takes place not in the browser, but in the server. Some servers support JavaScript so you can write programs that can handle data there as well. This is a specialised use of JavaScript that most JavaScript programmers do not get involved in.
© 2002 Ashley Preston |
||||
|
|
|||||