PDA

View Full Version : ssi and cookies to personalize site


schroom
10-27-2002, 01:15 AM
I was looking around and it appears that IE doesn't give an IP address and NS only if java is enabled. But I see that SSi does give an IP address, so the next step I guess - is I was hoping to have two different stlyes sheets depending on the iP address. Is this possible? I am not sure how to go about this?? Any suggestions.:confused:

Nightfire
10-27-2002, 01:42 AM
The IP has nothing to do with what browser people are using. The best way is to find out what the user-agent is to know what browser they're using.

One very simple way to to detect IE from Netscape (might not be the most practical way either) is:


<script>
if(document.all){
document.write('<link rel="stylesheet" href="styles/ie.css">');
}else{
document.write('<link rel="stylesheet" href="styles/ns.css">');
}
</script>


with ie.css being for IE, and ns.css being for NetScape

schroom
10-27-2002, 01:12 PM
Nightfire,
Thanks for your reply. Maybe I was not asking quite the right question, although, your reply, would be a possible. and simple at that. But what if I wanted to personalize a site, not by if they are using IE or NS, but by more of what they may be interested in viewing on the site. Displaying different information.