Hey,
If you can see below im using the getHeader method in one of my jsp pages and i want to call that into a variable that will read the referrer.
Next it will go through my loop ad find a site and if that site is the referrer it will print whatever line of content is specified.
My problem is, i wont know the exact URL of the referrer, is there a way to identify the referrer maybe by using just a key word from the address bar?
ass you can see in my example i have [url]www.yahoo.com[url]www.msn.com
[CODE]
<script type=”text/javascript”>
var referrer= “<% = request.getHeader(‘Referer’) %>”;
var mycontent = new Array();
mycontent[0]=’no from yahoo because..’
mycontent[1]=’your just come from a page containg a link called, Work!’
mycontent[2]=’no from msn because..’
if (referrer == “www.yahoo.com”) {
document.write(mycontent[0]);
}else if (referrer == “/messages-fw/internet/reftest.html”)
{document.write(mycontent[1]);
}else if (referrer == “www.msn.com”)
{document.write(mycontent[2]);
}else {
document.write(‘No Information!’);
}
</script>