Some Excellent JavaScripts

Brought to you by

What do they cost?
Nothing. They're FREE! compliments of their makers.

 

1) Break out of "hard" frames

Ever follow a link only to have the damned frame from some commercial site still in your browser? Surfers HATE that. And as a web site owner so should you. Here is a VERY good script written by Alan Simpson - www.coolnerds.com that breaks that pesky "hard" frame.

Place between your <head> and </head> tags

<script language="JavaScript"><!--
//-- JavaScript code written by Alan Simpson - www.coolnerds.com
   //If someone else tries to display this page within a frame, break out.
   if (parent.frames.length > 0) {
      parent.location.href = location.href
   }
//--></script>

This script written by Alan Simpson - www.coolnerds.com

 

2) No Spam E-mail Address JavaScript

You put your email on your website so people can contact you, only to have email harvester robots collect that address. Suddenly your inbox in inundated by unwanted SPAM. Here's the fix from CDR Software, brought to you by way of ZDNet DEVHEAD SCRIPT LIBRARY http://www.zdnet.com/devhead/resources/scriptlibrary/

Script Details:
BROWSER SUPPORT: IE3, IE4, IE5, NS3, NS4+
Author: CDR Software

 

To install this script, follow these simple steps:

1. Cut and paste this into the BODY of your document:


<script language="JavaScript">
<!--BEGIN Script
var name = "devhead";
var domain = "zd.com";
document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
document.write(name + '@' + domain + '</a>');
// -->
</script>

2. Update the variables ('name' and 'domain') with
your site's information.


Prevents spammers and e-mail harvesters from finding e-mail addresses on your web site. Simply update the variables with your e-mail information and replace your mailto: links to make this script active

 

3) Anti-Theft Graphics JavaScript

Again from ZDNet DEVHEAD SCRIPT LIBRARY http://www.zdnet.com/devhead/resources/scriptlibrary/

Script Details:
BROWSER SUPPORT: IE3, IE4, IE5, NS3, NS4+
Title: Theft-Proof Images
Author:
Dakota Smith
Date Submitted: January 19, 1999
Description: This ingenius little script will keep people from easily stealing your Web site's graphics. It uses a simple alert box triggered by an onMouseover event handler to keep users from using a right-click to download or view your site's graphics. This script, of course, isn't fool-proof. You can get around it by keeping your mouse on the image and then use the return key to de-activate the alert box. That way, you've already triggered the onMouseOver event -- and with your mouse still in the "onMouseOver" position, the alert box doesn't come up again. If anyone comes up with a better script, please e-mail it directly to DevHead.

To install this script, follow this simple step:

1. Cut and paste this into the BODY of your document, then change the image tag accordingly. You can add height, width and alt tags at will to the img src= part of the code.

<script language="JavaScript">
<!--
function or(){
alert ("This image is copyright protected.");}// -->
</script>
<a href="" onmouseover='or()'><img src="image.gif" border=0></a>

This script works for any file, not just .gif .


 

4) Disable Right Click Anti-Theft JavaScript

And another one to help dissuade theft of copyrighted material. This one comes thanks to SeeDesigns http://seedesigns.com/dev/

This doesn't work in NetScape Navigator 3.04 Gold, and I don't know if it works with Communicator since I won't let that computer-ravaging piece of crap near my drives, but it works well with IE 4+. As usual, there are always ways around this, but it will discourage the less computer savvy and will at least add the reminder that the material is copyrighted. I use 3 and 4 together, plus copyright notices. Of course, the best way to protect your property is to not put it on the internet. Next best is to watermark it in such a way that even a good graphic artist with good graphics software has a very difficult to impossible time removing it.

Place in the HEAD of your page.

<script language="Javascript">
function click() { if (event.button==2) {alert('Sorry, Right click is disabled')}}
document.onmousedown=click
</script>

You can change the message between the {alert('                ')}}


web site design - WebArt by Zentao