Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-01-2006, 07:12 PM   #1
Pete-KT
Workin With The Devil
 
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
is there a way to tell if a user is using IE or FF and...

is there a way in an html to tell if the user is using ie or FF and if its FF to use a differnt part of code instead of using the code for ie?
Pete-KT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:13 PM   #2
JOKER
Facit Omnia Voluntas
 
JOKER's Avatar
 
Industry Role:
Join Date: Apr 2003
Location: Offshore
Posts: 2,105
Yes, there is.
__________________
Facilitation - BizDev - Traffic - Consulting - Marketing
Skype: jokerempire | Silent Circle: joker

JOKER is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:16 PM   #3
Pete-KT
Workin With The Devil
 
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
Ok so how do i do it?
Pete-KT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:16 PM   #4
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
Code:
<script>
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)

//if NS 6
if (browser_typehahahaha"Netscape"&&browser_version>=5){
document.write("your using netscape");
}
//if IE 4+
else if (browser_typehahahaha"Microsoft Internet Explorer"&&browser_version>=4){
document.write("your using ie");
}
//if firefox 1+
else if(navigator.userAgent.indexOf("Firefox") != -1){
document.write("Your using firefox");
}
//if NS4+
else if (browser_typehahahaha"Netscape"&&browser_version>=4)
{
document.write("Your using netscape");
}
//Default goto page (NOT NS 4+ and NOT IE 4+ or firefox)
else
{
document.write("i dunno what your using");
}
</script>
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:18 PM   #5
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
hmm stupid gfy parse out the = = ... ill try it again


<script>
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)

//if NS 6
if (browser_type=="Netscape"&&browser_version>=5){
document.write("your using netscape");
}
//if IE 4+
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4){
document.write("your using ie");
}
//if firefox 1+
else if(navigator.userAgent.indexOf("Firefox") != -1){
document.write("Your using firefox");
}
//if NS4+
else if (browser_type=="Netscape"&&browser_version>=4)
{
document.write("Your using netscape");
}
//Default goto page (NOT NS 4+ and NOT IE 4+ or firefox)
else
{
document.write("i dunno what your using");
}
</script>
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:19 PM   #6
JOKER
Facit Omnia Voluntas
 
JOKER's Avatar
 
Industry Role:
Join Date: Apr 2003
Location: Offshore
Posts: 2,105
Quote:
Originally Posted by SmokeyTheBear
Code:
<script>
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)

//if NS 6
if (browser_typehahahaha"Netscape"&&browser_version>=5){
document.write("your using netscape");
}
//if IE 4+
else if (browser_typehahahaha"Microsoft Internet Explorer"&&browser_version>=4){
document.write("your using ie");
}
//if firefox 1+
else if(navigator.userAgent.indexOf("Firefox") != -1){
document.write("Your using firefox");
}
//if NS4+
else if (browser_typehahahaha"Netscape"&&browser_version>=4)
{
document.write("Your using netscape");
}
//Default goto page (NOT NS 4+ and NOT IE 4+ or firefox)
else
{
document.write("i dunno what your using");
}
</script>

What he said, without the hahahaha

STB
__________________
Facilitation - BizDev - Traffic - Consulting - Marketing
Skype: jokerempire | Silent Circle: joker

JOKER is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:20 PM   #7
Kevsh
Confirmed User
 
Join Date: Dec 2004
Location: TO
Posts: 8,619
Quote:
Originally Posted by Pete-KT
is there a way in an html to tell if the user is using ie or FF and if its FF to use a differnt part of code instead of using the code for ie?
In pure HTML?
Nope. You'll have to rely on JavaScript, etc. for the detection and it can update the tags parameters (visible/not visible).

eg. (in sort of a mashed pseudo-code)

<script>
IF browser = IE then one.visibility="visible"
ELSE two.visibility="visible"
</script>

<DIV ID="one" STYLE="visibility: hidden">
IE stuff here
</DIV>

<DIV ID="two" STYLE="visibility: hidden">
FF stuff here
</DIV>

I'd look up the exact elements/parameters but this is the basic idea, I did something like this a LONG time ago and it should still be viable.
Kevsh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:21 PM   #8
czarina
Webmaster Extraordinaire
 
czarina's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: A beautiful beach...
Posts: 10,748
you are quick on the draw smokey.
czarina is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:22 PM   #9
Kevsh
Confirmed User
 
Join Date: Dec 2004
Location: TO
Posts: 8,619
Edit: The advantage of this method is it's a little easier on the search engines and anyone having to read the code. And personally, I hate outputting HTML from a <script> tag
Kevsh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:22 PM   #10
BigBen
Confirmed User
 
Join Date: Nov 2004
Location: scv
Posts: 2,299
http://sourceforge.net/projects/phpsniff/
http://us3.php.net/manual/en/function.get-browser.php
BigBen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:23 PM   #11
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Remember, though, that 5-10% of users have javascript disabled, so you also need some <noscript>content</noscript> if you use js for the output.
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-01-2006, 07:34 PM   #12
Theo
HAL 9000
 
Industry Role:
Join Date: May 2001
Posts: 34,515
over 10 posts and nobody told you this is a newbie question ;-)
Theo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.