Forum Moderators: open

Message Too Old, No Replies

Can anyone explain this

new to java script

         

humpingdan

11:54 am on Mar 8, 2004 (gmt 0)

10+ Year Member



<script language="JavaScript" type="text/javascript"> function Start() {brwName = navigator.appName; if (brwName == "Netscape" )
{window.parent.location="**.villa.rental.php"} else
{window.parent.location="**.villa.rental.php"} }</script>

i think i have an idea of what is done here...but an expert opinion wud be appreciated,

also what are the benfits of doing this, i think the above code is purely for SEO purpuses the web page in question also uses a <php include> statment furthur on in the page, why?

any pointers? i can sticky url if desired?

Dan

jetboy_70

12:29 pm on Mar 8, 2004 (gmt 0)

10+ Year Member



It's a browser sniffer. It test for the word 'Netscape' in the browser identity string, and redirects the user to one page if it's found, and another if it isn't.

It's more than likely to be for design issues (a site that doesn't work in Netscape 4 perhaps) than search engine reasons. *Most* search engine spiders will ignore the Javascript redirect and just spider the rest of the page it's on. It's also a far from foolproof method to filter out a single browser - I believe this code will also redirect Opera - browser sniffing is a complex art.

humpingdan

12:50 pm on Mar 8, 2004 (gmt 0)

10+ Year Member



so even though the redirect is there a robot would look at the content of the page but the user gets redirected to another php page? isnt this spam?

hes alos got loads of content at the bottom of the html file which isnt shown to the user but would be found by a robot!