It looks like JavaScript has become the latest weapon in an Internet flame war. Earlier this week, I found the following JavaScript code embedded in the Proctor & Gamble (P&G) home page:
http://www.pg.com/
<script language="JavaScript">
var ref = unescape(document.referrer);
if (ref.indexOf("http://www.pginfo.net/") >= 0) {
window.location="http://www.pg.com/animalalternatives/"
}
</SCRIPT>
An English description of this code goes something like
this:
If the person viewing this page got here by clicking on a link from the Web site www.pginfo.net, redirect them from the P&G home page to page called "animalalternatives".A quick check of the "animalalternatives" page, takes us to slick Web page where P&G talks about their goal to eliminate the use of animals in the testing of consumer products. P&G is one of the world largest producers of personal care and household products. Historically many of these products have been tested using animals to make sure the products are safe on humans. Because of public pressure from various animal rights groups, P&G is looking to move away from animal testing.
So why is P&G redirecting people to this page who come from www.pginfo.net? A quick check of the pginfo Web site shows why. In spite of the domain name, it is not a Proctor & Gamble Web site at all. Instead, it is run by PETA (People for the Ethical Treatment of Animals), a high profile animal-rights organization.
Apparently P&G is using the JavaScript redirect trick to put on the best possible face for people who are likely to be against animal testing.
However, the www.pginfo.net Web site apparently caught on to the trick and no longer includes a link to www.pg.com. PETA's main Web site, www.peta-online.org does include a number of links to the P&G home page, but P&G currently does not redirect these links.
The P&G JavaScript redirect trick illustrates how the Web can be used to present customized information in some very unexpected ways.