Javascript Problem
- Started
- Last post
- 10 Responses
- 187LockDown
Im trying to write a script to detect all versions of AOL Browser to be redirected to a fuck off page, my problem is that currently Im using the navigator.useragent and stripping out characters 52-59 to get a new string. I then test this against predefined strings I have declared. ALl I need to do is to be able to redirect all AOL users. Is ther an easier way?
- mitsu0
better yet, implement the hallucinogenic tea script.
- 187LockDown0
yeah... Thanks. Tea I will do that.
- Jnr_Madison0
"to be redirected to a fuck off page"
LMAO :)
- unfittoprint0
why don't you just make an alert message box saying:
"You AOL? FUCK OFF!!"
- AnthonyCozzi0
what a design NAZI!
- gabriel_pc0
what is it that's not working in AOL? Their newer browsers aren't too bad. IE clones.
- takashi0
You are trying to do something impossible:-))
quote from
http://www.mozilla.org/docs/web-… :"Thus, client-side JavaScript code which attempts to detect the AOL client by looking for the string "AOL #.#" in the navigator.userAgent string is not 100% reliable. "
check this:
"There is currently no known workaround to detect the AOL client with 100% reliability in client-side JavaScript, so the recommended workaround when AOL client detection is necessary is to use server-side detection of the HTTP user agent string." ... so go PHP...:-)
- 187LockDown0
It's actually not quite impossible, there are a few ways:
Javascript: Use navigator.useragent.indexOf and look for the string AOL. A small amount of AOL Browsers do not have the AOL in the useragent string. Not the best Idea..
Active X: You can buy a small program called BrowserHawk that is installed on your server. This makes it possible to access Active X controls through ASP. We only need to find AOL browsers, this is a bit overkill and costly.. $100+
ASP.NET: Use
if Request.Browser.AOL = True
This seems to work perfectly and As I understand, does not use a useragent string to determine the value of True. All AOL Broswers should show themselves using this method.
- 187LockDown0
This ASP.NET way does not work either.
- takashi0
have a try with phpsniff: