Tips for the Philatelic Webmasters

The Philatelic Webmasters Organization (PWO) starts bringing to interested Webmasters useful tips for their publishing activity. Usually these are short advice or small pieces of code. All readers who wish to share their knowledge are invited to make proposals by e-mail. The best of them will be published on this site, mentioning the name of the person who supplied the proposal. Please include with your proposal also the URL of a Web page where the proposal was implemented. Thanks a lot in advance!

1. Protect your images against grabbing with this simple code

This code will stop people from right-clicking on your image and then saving it to their hard drive. The solution is to put in this JavaScript in the page that you would like to protect. Not useful when the browsers are Navigator with the version number smaller or equal to 3 and IE version number smaller or equal to 2. Please note that the protection that this code offers is rather limited.

<SCRIPT LANGUAGE="JavaScript">

<!-- This script is offered by PWO: http://www.pwmo.org -->
<!-- It protects your images from being grabbed. -->
<!-- Only against visitors using NN versions greater then 3 and IE using vers. GT 2 -->
<!-- You can change the text: "Sorry, this is my scan." by anything you wish -->

<!-- Begin

function test(x) {
  var msg = "Sorry, this is my scan.";
  if (navigator.appName == 'Netscape' && x.which == 3) {
     alert(msg);
     return false;
   }
  if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
    alert(msg);
    return false;
  }
  else return true;
}

function getit() {
  if(document.images)
    for(i=0;i<document.images.length;i++)
  document.images[i].onmousedown = test;
}
// End -->    

</SCRIPT>

<body onLoad="getit()" >

Supplied by Victor Manta, PWO President. Example 


2. Don't let other sites jail your pages in their frames

This very short code will free your page from their frames. Especially useful for the front page of a site. To test it, try to insert the page from the example in a frame of your site.

<SCRIPT LANGUAGE=JAVASCRIPT>

<!-- This script is offered by PWO: http://www.values.ch/PWO.htm -->
<!-- It will free your page from the frames of another site that try to display it -->

<!-- Begin
if (top.frames.length!=0)
  top.location=self.document.location;

// End -->

</SCRIPT>

Supplied by Victor Manta, PWO President. Example 


 
Created: 05/14/01. Revised: 11/27/05 .
Copyright 2001 by PWO and
by Victor Manta, Switzerland
All rights reserved worldwide.