Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/ausmall/public_html/freegraf/resrce2.php on line 21

Warning: include(http://www.ausmall.com.au/freegraf/includes/freegrafheader.htm): failed to open stream: no suitable wrapper could be found in /home/ausmall/public_html/freegraf/resrce2.php on line 21

Warning: include(): Failed opening 'http://www.ausmall.com.au/freegraf/includes/freegrafheader.htm' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ausmall/public_html/freegraf/resrce2.php on line 21
More About
JavaScript And CGI

If you're confused about the difference between JavaScript and CGI scripts, here's a quick explanation that might help:
  • JavaScript is a simple programming language that was developed by Netscape in 1995 as a way to extend the capabilities of web browsers and web pages.

    It was originally called Mocha, then LiveScript, and finally JavaScript after Netscape struck a licensing deal with Sun Microsystems (the name helped promote Sun's Java programming language, though it really has little connection with JavaScript at all).

    Microsoft also developed their own version of JavaScript but to avoid paying Sun any licensing fees they called it JScript. These days, though, there's very little practical difference between JavaScript and JScript.

    In a nutshell, JavaScripts are simple programs that are embedded in web pages along with HTML. When a browser finds a JavaScript on a web page it compiles the script and executes it on the spot, displaying the results in a browser (for example, a live date on a web page).

  • CGI Scripts, on the other hand, are stored in the cgi-bin of a web server (or some other area of the web server that's been set aside to run scripts).

    Most CGI scripts are written in Perl, which is a full-blown programming language that was first invented  in 1987 and which has many uses outside web servers (eg: in graphics programming, system administration etc). However, scripts can also be written in other programming languages such as C, C++ or Microsoft's ASP

    Perl scripts - unlike JavaScripts - are not embedded in web pages. Instead, calls to the scripts are pasted into web pages (usually as links).

    And when the script is called (eg: by clicking a link or pressing a button on a form), the web server's CGI-bin will run the script and display any results on the screen as a HTML page (eg: "Thankyou for submitting this form")

JavaScripts are very easy to embed into a web page and most can be added by simple cut-and-paste. The main problems that can occur with JavaScripts are browser incompatibilities (ie if you use an older JavaScript it may not run in a modern browser because the language has undergone several upgrades over the years to patch security holes that existed in earlier versions) and conflicts that may be caused by running several scripts on the same page.

Perl scripts, by contrast, are usually more difficult to set up because you'll need to specify the path to the Perl interpreter on your web server; upload the script to your cgi-bin after you've set the path in the script; set web server permissions if you're running on a Unix/Linux web server (as most people are); and then test and modify the script until you're happy with it.

But while Perl scripts aren't as easy to use as JavaScript, they're capable of doing much more than JavaScripts (eg: running a bulletin board, blog, database etc). This is because Perl is a fully formed programming language compared to JavaScript.

Furthermore - because Perl scripts are executed on your web server rather than in a visitor's browser - they're also more reliable than JavaScripts (eg: a user can turn off JavaScript in their browser, but they can't turn off a Perl script).

Javascripts And CGI Scripts
JavaScripts and CGI scripts are an easy way to make your site come alive. Whether it's a guestbook, a light-bar menu, messages in your browser's status bar, pop-ups or live dates, they're all pretty easily accomplished with one or the other.

Even better, there are now many superb sites on the Internet which allow you to cut and paste pre-written, fully tested scripts for free.

So you don't need to be a rocket scientist to use them. And you don't need to learn how to program in JavaScript or Perl either (a superficial understanding of how they both work is usually good enough).

These days JavaScript is equally well-supported by all the major browsers. But you should be aware that some very early JavaScripts no longer work correctly in modern browsers . This is because the JavaScript language has evolved and improved quite a lot over the years.

So if you plan to use JavaScripts extensively on your web site you should try to test your scripts under the latest releases of Internet Explorer and Firefox (which - between them - account for about 98% of the browser market).

If a JavaScript works correctly in both these browsers then it's very likely that it will work for the overwhelming majority of your web site visitors too.

CGI scripts, though (which are most commonly written in the Perl language), will work equally well with all browsers. This is because they're executed on your web server rather than in a visitor's browser when a web page loads (see our sidebar story for a quick explanation of the differences between JavaScripts and CGI scripts) .

We've listed the best free JavaScript and CGI resources we know about below. But if you find one we've overlooked, then please tell us about it. We'll be happy to add it to the list.

 
Cut-And-Paste Javascript Resources
Dynamic Drive is a marvellous source of pre-tested, reliable JavaScripts and DHTML scripts that will work in a wide range of different browsers. It also has lots of tips, tricks and expert advice too (including what causes JavaScript conflicts when you run multiple scripts on a single page and how you can circumvent the problem). This is a resource that we've used many, many times over the years and one that we can highly recommend.

The JavaScript Source is part of Internet.Com's network of programming sites and it offers more than 1,400 free cut-and-paste JavaScripts along with JavaScript tutorials, books, a message forum and a regular email newsletter. If Dynamic Drive (above) hasn't got a JavaScript to satisfy your needs, this is another terrific place to look.

This is another very useful site that also offers hundreds of free cut-and-paste JavaScripts, JavaScript tutorials, books and a message forum. This site also has links to many other web resources in areas outside JavaScript. We've found this a useful resource on several occasions, and you might too.

 

JavaScript Educational Resources
If you'd like to know the history of JavaScript, Wikipedia's summary provides a great background on the origins and development of the language. The Wikipedia entry also has links to many useful related resources in this area.

W3Schools are the Internet's defacto training school and their very extensive and thorough JavaScript Tutorial is probably the best place to learn JavaScript from the bottom up. These crisp, clear and thorough tutorials will get you up to speed on Javascript remarkably fast, and are a great place to start learning about the language.

This site is part of the much larger WebTeacher.Com site and it offers a tutorial on JavaScript for people with nil or very limited exposure to programming. If you're completely new to JavaScript and/or would like to increase your knowledge about how it works quickly, then this excellent and easy-to-read  tutorial can accomplish part of what W3Schools (above) can do for you in a shorter time (NB: This site also has a CGI tutorial)

JavaScript.Com is an Internet.Com resource site and its primary focus is on JavaScript tutorials and resources rather than cut-and-paste scripts (you should go to its cousin The JavaScript Source, above, for those). However, if you've mastered basic JavaScript programming and want to extend your knowledge, this is a very good reference site and its excellent tutorials and tips can teach you quite a lot about the more obscure ins and outs of this simple - but sometimes maddening - programming language.

 

Cut-And-Paste CGI Script Resources
This very famous site has more than 16 free cut and paste CGI scripts for adding counters, guestbooks, random image displays, free-for-all lists and other useful add-ons to your site. Matt's Script Archive is also the home of FormMail, which is probably the most widely-used script in the world for processing web forms and emailing you the contents (eg: a "Contact Us" form). Each script is well documented and very easy set up and install, but Matt's site also has an FAQs page and a Help Centre if you need additional assistance.

This CGI Resource Index contains reviews and links to several thousand CGI scripts in hundreds of categories - anything from freeware offerings through to full-blown commercial applications. This is probably the single most authoritative collection of CGI scripts on the Net and the chances are that if you want to do anything with a script, someone's already programmed it and you can find it here. The CGI Resources Index also contains listings for CGI programmers so that if you need to hire some ad-hoc programming talent for your web site, you can also find Perl programmers here too. We've use this site many times over the years, and can highly recommend it.

Another terrific script resource we can highly recommend is HotScripts.Com. Like the CGI Resource Index (above), HotScripts contains reviews and links to several thousand CGI, ASP and PHP programs along with many more obscure and/or emerging scripting languages like Python, Ajax etc. HotScripts list both free and commercial scripts and this is a resource we've found ourselves turning to many, many over the years. In fact - between the CGI Resource Index and this site - we've rarely had to venture elsewhere to find a script to solve any requirement that we've had or our clients have had.

 

CGI Script Educational Resources
If you'd like to know the history of Perl, Wikipedia's summary provides a great background on the origins and development of the language. The Wikipedia entry also has links to many useful related resources in this area.

Microsoft developed ASP as a proprietary answer to Perl (which is a public domain programming language). ASP works in a similar fashion to Perl, though, and Wikipedia's entry provides some details about it, along with relevant links to other resources if you'd like to find out more.

CGI stands for "Common Gateway Interface", and this academic resource provides lots of information about how CGI works, including suggested uses for CGI and how to deal with the potential security problems that can surround CGI. This site can be useful to both systems administrators and webmasters keen to extend their knowledge about CGI in general.

 

This page last updated: 15-Oct-2009

 


Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/ausmall/public_html/freegraf/resrce2.php on line 492

Warning: include(http://www.ausmall.com.au/freegraf/includes/freegraffooter.htm): failed to open stream: no suitable wrapper could be found in /home/ausmall/public_html/freegraf/resrce2.php on line 492

Warning: include(): Failed opening 'http://www.ausmall.com.au/freegraf/includes/freegraffooter.htm' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ausmall/public_html/freegraf/resrce2.php on line 492