Brower detect ...again

liunx

Guest
Hi, first let me say I know there's alot of posts regarding detecting the browser here, but I couldnt find anything specific to my problem. Thanks.<br />
<br />
Im wondering if there is a way for my html webpage to identify if a person is using AOL, and if so, send them one picture, or if they're using any other browser send them another picture and what the code would be?<br />
<br />
In lay-mans terms:<br />
<br />
if (aol) show img-aol.jpg<br />
<br />
else show img-everythingelse.jpg<br />
<br />
<br />
Thanks.<!--content-->alert(navigator.userAgent)<br />
<br />
should display the string which you can parse accordingly<!--content-->Thank you, however, I do not know how to do that. Could you please be a little more specific. Where do I put that info and how would I set up the if-then-else statement?<br />
<br />
Thanks.<!--content-->What Khalid is saying is to create a webpage with that piece of script in it, and then display the page using AOL. You will get an alert with the value of the browser that you can then use to test against. BTW when I use that with AOL 9 it just tells me that it's using IE under the covers....<!--content-->I think something like this will work:<br />
<br />
<script language="JavaScript"><br />
<br />
if (navigator.userAgent.indexOf('AOL') != -1 ) <br />
{<br />
showImg.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"img-aol.jpg";<br />
} else {<br />
showImg.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"img.jpg";<br />
}<br />
</script><br />
<br />
<br />
<img name="showImg"><!--content-->
 
Back
Top