Home
Username:
Password:
Web Publishing and Publicizing Tutorials

Web Concepts and Technologies / Javascript & VBscript

Subtitles of the Movie

Yet another way to add functionality to your web pages is to employ something like JavaScript or VBScript. These are scripting languages, now just a little note on scripting languages versus real languages. You remember that we talked about Java, not JavaScript but Java; Java is a real programming language. Real in the sense that it is compiled, real in the sense that it will take you a long time to learn, whereas Perl, we talked about Perl in relation to CGI bin, Perl is a scripting language. Perl however is a server side scripting language and JavaScript and VBScript are client side scripting languages. They add ‘simple’ functionality to your web page, note the accent on the word simple there. Its not so much that you can with JavaScript and VBScript, not like Java. So the benefit is that they’re simple to learn and simple to program. The downside is that they don't do all that much. You can't use them to create, say a Tetris game like I showed you in the last chapter but the most popular browsers of the day Internet Explorer and Netscape Navigator, both support JavaScript and VBScript as their scripting languages of choice and so it’s probably worth while learning one or both of these languages. If you had to choose, I would say learn JavaScript. These languages are named as they are because JavaScript in similar in syntax to Java and VBScript is similar in syntax to Microsoft Visual Basic. In fact Microsoft has actually developed VBScript as a competitor to JavaScript trying to make it the standard. Everybody is trying to make it the standard but they’re both the standard at the moment. As I mentioned a moment ago both of these are client side languages, in other words your browser runs these scripts. The ability to understand a JavaScript or a VBScript program is built into your browser, Internet Explorer or Netscape Navigator. And the text of the scripts, in other words the actual code is usually written inside the HTML file. This means that once you have downloaded the HTML file, you have all the information you need to run the script. You don't have to contact the server again in order to run the script. Client side scripting languages such as these can be used for, well a variety of purposes, here’s a very small sample. Form validation, that means when someone is entering their data into a form, I showed you forms in a couple of modules ago A script could be employed to insure that the dates are entered in the correct format or that you've specified a postcode or whatever. There are in fact a variety of ways of doing that, some of them are server side and some of them are client side. The client side ones will obviously be done using JavaScript or VBScript. You can use VBScript or JavaScript to pop-up menus as the mouse moves over certain areas of the web page. You can get it to pop-up a window, I’m talking about a separate browser window when the user clicks on something and there is a bunch more functions that just I’m not going to go into, they’re all quite simple. I will however show you some examples of those now. This is the Common Wealth Bank of Australia's website and it’s got these little menus here which have little pop-ups, pop-up descriptions as you move your mouse over different parts of the web site. And if we have a look at the source for this, view source, we find that here is the script, the script and the language is JavaScript version 1.2 and the script goes from there all the way down, this is all script, this is all still script, this is inside the HTML file mind you, and the script continues on, well it continues quite a way and I’m sure it does more than just pop-up those descriptions on the form and we'll get there. Okay, there's the end of that script and there is the start of another script and so on and when you finally get down to the bottom of the page, you can actually find some HTML. On Ontracks website we've got a similar sort of thing, menus pop up as you move your mouse over certain areas of the screen and they’re sliding up and sliding down, isn't that lovely? Okay, that's another example of something that JavaScript can do for you. On the Australian white pages site, again we've got this little help button here. We click on it, context sensitive help and up pops a little help window. That is a very simple piece of JavaScript functionality. Now that we have seen the various different types of languages available to us, it’s probably worthwhile just taking a moment to summarize the differences and similarities between these languages. Let’s do that in the next movie

Tutorial Information

Course: Web Publishing and Publicizing
Author: Mark Virtue
SKU: 33298
ISBN: 1930519729
Release Date: 2002-03-11
Duration: 6 hrs / 61 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available