Skip navigation
 SNIPPET MENU
  • Alert Box - Email
    Form Field Required
  • Table Rows with
    Alternating Colors
  • Track Search
    Engine Spiders
  • Track Hits from
    Inbound Links
  • Protect your MailTo
    Link from Spammers
  • Overlay Box
    Instead of Popups
  • Form Submission
    No Double-Click
  • Change Dates
    Automatically
  • Is it Standard
    or Daylight Time?
 

Code Snippets

These snippets provide code that you can use on your own web page. All you need to do is Copy & Paste. Of course, you may need to customize the code for your own website. Full instructions are given for how to use the code on your web page.

Where possible, there is a button to "See it in action", so you can decide if it will be useful on your site. Another button will allow you to "Get the code" from a small window.

Javascript: Many of the code snippets are written as javascript functions, and are designed to be unobtrusive. Consequently, the functions must be added to the page when the page loads.

To use such a javascript, it must be located in a seperate file. This file should NOT contain <script> tags, as these are used only on the webpage itself. Put the script file in a seperate folder, for convenience. Once the script is so located, then it is brought onto the webpage by putting a line like this in the <head> section:

<script type="text/javascript" src="scripts/dates.js"></script>

If the script is supposed to run when the page loads, then it must be told to do so. If you only need to run one script, then add a line like this in your script file, right after the function:

window.onload = dates.js;

If more than one script needs to be run on page load, you will need to use some other way, since you can't use window.onload twice. I highly recommend Simon Willison's addLoadEvent function. It allows you to easily load any number of functions at once. Then you can make a script file for each webpage, make 'addLoadEvent' the first function in this file, and use it to add ALL necessary functions to your webpage when it loads.

Other useful advice: I assume that you have a website that you want to design or improve. If you don't have your site online yet, I would recommend that you sign up with a server ASAP. There's no substitute for actually trying the code on your own page.

You will need some tools to make things easier to do, such as an FTP transfer program and a text editor. Check out the Webmaster Tools page for some of the tools that I use. There are even some free ones!



Here's an idea

Take 3 separate ways to bring traffic to your site - using affiliates, distributing articles and creating ebooks.

There's a way to link all these together to produce a rapid multiplying effect which will increase your traffic by an exponential factor.

Ads by The Professor

AddThis Social Bookmark Button
7807 Lerkenlund, St. Thomas, VI 00802 Tel: 340.715.3542
Copyright ©  Professional Website Design Website by: The Professor About Me Site Map
Valid XHTML 1.0 Transitional
Valid CSS
Level AAA conformance, W3C-WAI Web Content
          Accessibility Guidelines 1.0
Level AAA conformance, Disabilities Act Section 508
Professional Website Design logo

Professor's Coding Corner

  • Home
  • Code Snippets
  • Tutorials
  • Articles
  • Resources
    • HTML & CSS
    • Javascript
    • Perl
    • Tools
    • Other
  • Contact