No Right Click

Place this script between the head tags. You can change the wording in Red. Just be aware that these "no right click" type scripts only deter the inexperienced user. There are many ways around them.

<script LANGUAGE="JavaScript">
<!--
function click() {
if (event.button==2) {
alert('Right Click Option Not Available!');
}
}
document.onmousedown=click
// -->
</script>




Bookmark Page

Paste this snippet in the body of your document where you want the link to appear. Change the script in Red.

<a href="javascript:window.external.AddFavorite('http://www.yoursite.com/', ' My Site Title');">Bookmark This Site!</a>

This script only works for IE5+ browsers.


Close Window With A Link

Add this short snippet to the body of your popup windows so that they can be closed easily.

<a href="javascript: self.close()">Close Window</a>


Add the current date to your page.

This script will add the date in the form dd month yyyy (eg. 7 January 2010). Just copy and paste it into the document where you want it to appear.

<script language="JavaScript">
<!--
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}
var months = new makeArray('January','February','March','April','May','June', 'July','August','September','October','November','December');
var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 2000 : yy;
document.write(day + " " + months[month] + " " + year);
//-->
</script>


Example>

Disclaimer of Liability. The user assumes all responsibility and risk for the use of this web site and the Internet generally. Under no circumstances, including negligence, shall anyone involved in creating or maintaining this web site be liable for any DIRECT, INDIRECT, INCIDENTAL, SPECIAL or CONSEQUENTIAL DAMAGES, or LOST PROFITS that result from the use or inability to use the web site and/or any other web sites which are linked to this site. Nor shall they be liable for any such damages including, but not limited to, reliance by a member or visitor on any information obtained via the web site; or that result from mistakes, omissions, interruptions, deletion of files, viruses, errors, defects, or any failure of performance, communications failure, theft, destruction or unauthorized access
Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that of Objective C. Java should not be confused with JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates Java regularly.
Adobe Flash Player is the standard for delivering high-impact, rich Web content. Designs,  and  animations
File Size: 2,257 K
Automatic Print Script

This is a super-easy little script that you can use to form an automatic print-page link on your site. Just insert this script where you want the link to display and your visitors can choose to print the page they are viewing.

<a href='javascript:;' onClick='window.print();return false'>Print this page.</a>

This is an example.


Updating Copyright Notice

This copyright notice palces the current year on the page so that copyright notices are always current. Once it's on your page there is no need to update the script.

<script language = 'JavaScript'>
<!--
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
var today = new Date();
var year = y2k(today.getYear());
document.write('© '+year+' all rights reserved');
//-->
</script>

Example © 2007 all rights reserved



Back to Top of Page link

Use this script if you have a long page.

<a href="javascript:window.scrollTo(0,0);">Back to top of page</a>

Example


Back to top of page
Print this page.
BACK