Toolkit, Links and More: Scripts
Javascript
There are many excellent sources for JavaScript tutorials and code snippets freely available on the web. And most of these sources cover a variety of web programming languages, not only JavaScript. Here are a few of the most popular ones:
A List Apart
Tigra Products from Softcomplex
JavaScript Source
JavaScipt.com
W3 Schools JavaScript Tutorial
Wikipedia: JavaScript
JavaScript Kit
Earthweb JavaScripts
WebReference JavaScript
About JavaScript
CodeHouse JavaScript
ScriptSearch.com
CGIScript.net Free Javascript
Bravenet.com
Matt's Script Archive
Making Javascript compatible with XHTML
CodeHouse JavaScript Tips
About JavaScript and XHTML
HTML Goodies: XHTML
The Back Link
<a href="javascript:history.go(-1)">Back</a>
This code snippet will provide a simple link back to the page where the visitor was before
visiting the current page, but keep in mind that it is safer to provide a link
to a specific page.
New Window Closer
Button:
<form>
<input type="button" value="Close Window" onClick="window.close()">
</form>
Text link:
<a href="javascript:window.close()">Close Window</a>
Bookmark This Page
Add the following JavaScript code in the <body></body> section of your page, where you want the call to action to appear, with the correct url and title inserted. This script will create a Mozilla Firefox bookmark, an Internet Explorer favourite, or an Opera hotlist item.
<script type="text/javascript">
<!--//
function CreateBookmarkLink() {
title="Title of the web page";
url="http://www.website.com/page.html";
if (window.sidebar) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,"");
} else if( window.external ) { // IE Favorite
window.external.AddFavorite( url, title);
} else if(window.opera && window.print) { // Opera Hotlist
return true; }
}
if (window.external) {
document.write('<a href="javascript:CreateBookmarkLink()");">Add this page to Favorites.</a>');
} else if (window.sidebar) {
document.write('<a href="javascript:CreateBookmarkLink()");">Bookmark this page.</a>');
} else if (window.opera && window.print) {
document.write('<a href="javascript:CreateBookmarkLink()");">Add a Bookmark for this page.</a>');
}
//-->
</script>
<noscript>
<p>Remember to bookmark this page in your browser.</p>
</noscript>
Try it out here:
Email Addresses on the Web
There are various methods to reduce spam to email addresses on the web, but this one by Deena uses a neat snippet of JavaScript:
<script type="text/javascript">
<!--
var username = "username";
var hostname = "yourdomain.com";
var linktext = username + "@" + hostname;
document.write("<a href=" + "mail" +
"to:" + username +
"@" + hostname +
">" + linktext + "</a>")
//-->
</script>
Drop Menus
Softcomplex provides the excellent free Tigra drop menu scripts and an online tool with which to customise your drop menus. Also very useful is the Tigra tree menu.
And then there is the popular Suckerfish dropdown menu that was first described in A List Apart, and later the Son of Suckerfish Dropdowns in htmldog.com. Have a look at this use of the unordered list and minimal Javascript to produce a lightweight dropdown menu.
Free Games
Just Free Games offers free games you can embed in your site, served up from their site, or you can download the games.
Search
Various sites offer free search code, for example:
Google Free Search Code
FyberSearch
ExactSeek
Matt's Script Archive
Bravenet.com Webtools
FormMail
Google Maps
Google Maps API lets you embed Google Maps in your own web pages with JavaScript. You can add overlays to the map (including markers and polylines) and display shadowed "info windows". The Maps API is a free service, available for any web site that is free to consumers.
Mike Williams offers a Google Maps API Tutorial.
Google Blogger
Blogger provides a blog that is your easy-to-use, customisable web site, where you can quickly post thoughts, interact with people, and more. An atom.xml feed is automatically generated as part of the service. This one is excellent, and it's free.
Chicklets
Chicklets are mini-icons that make it easy to add your blog to feed aggregators and social bookmark sites like del.icio.us and Netvouz with one click. You can find more information on adding chicklets to your blog with the Chicklet Creator. If you are using free blog software and hosting it may not be possible to add these extra functions, so plan ahead when choosing your platform. Chicklet Creator is a free code generator service.
Common Gateway Interface
TheCgiSite.com
CGI Resource Index
Mailing List Service
Bravenet.com provides a free mailing list hosted service that you can add to your web site.
Keyword Popularity Checker
Use the FreeWebSubmission.com Keyword Popularity Checker to discover new keywords, to check the popularity of your current keywords, to check keywords from competing websites, and to assist you in the development of a Search Engine Optimization strategy.
FreebieList.com
FreebieList.com is a listing of links to all kinds of free stuff available on the internet, for example games, fonts, graphics, animations, etc. Of special interest is the webmaster resources section which includes links to JavaScript and CGI sites, and much more.