检查浏览器是否不是I.E. [英] Check if browser is NOT I.E.

查看:92
本文介绍了检查浏览器是否不是I.E.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在针对IE优化的页面上,我想检查浏览器类型是否比IE浏览器类型更好,所以我可以将它们引导到另一个页面。

如果使用IE浏览器不是
,我如何修改下面的代码重定向到indextext.asp?我已经尝试更改= for<>,但是语法错误。


谢谢


USER_AGENT = Request.ServerVariables (HTTP_USER_AGENT)

IS_IE = InStr(USER_AGENT," MSIE")

如果IS_IE则

response.redirect" indextext .asp"

结束如果

解决方案

" David" <哒*** @ brown6669.freeserve.co.uk>在消息中写道

news:5q ************** @ newsfep3-gui.server.ntli.net ...

On一个针对IE优化的页面,我想检查浏览器类型是否比IE更其他,所以我可以将它们引导到另一个页面。

如何修改下面的代码如果
没有使用IE,重定向到indextext.asp?我已经尝试更改= for<>,但是语法错误。




我希望这不适用于公共网站...浏览器嗅探是不好的做法。


Peter Foti


>我希望这不适用于公共网站...浏览器嗅探不好

练习。


为什么这么说?


Bob Lehmann


" Peter Foti" < PE *** @ Idontwantnostinkingemailfromyou.com>在消息中写道

news:10 ************* @ corp.supernews.com ...

" David" <哒*** @ brown6669.freeserve.co.uk>在消息中写道
新闻:5q ************** @ newsfep3-gui.server.ntli.net ...

在优化的页面上IE,我想检查浏览器类型是否为IE以外的
,所以我可以将它们引导到另一个页面。

如何修改下面的代码重定向到indextext .asp如果他们不是

使用IE?我已经尝试更改= for<>,但是语法错误。



我希望这不适用于公共网站...浏览器嗅探不好



练习。
Peter Foti



你发布的代码在我的机器上工作正常,你收到什么具体的语法错误




" David" <哒*** @ brown6669.freeserve.co.uk>在消息中写道

news:5q ************** @ newsfep3-gui.server.ntli.net ...

On一个针对IE优化的页面,我想检查浏览器类型是否比IE更其他,所以我可以将它们引导到另一个页面。

如何修改下面的代码如果
没有使用IE,重定向到indextext.asp?我已经尝试更改= for<>,但是语法错误。

谢谢

USER_AGENT = Request.ServerVariables(" HTTP_USER_AGENT")
IS_IE = InStr(USER_AGENT," MSIE")
如果IS_IE则
response.redirect" indextext.asp"
结束如果


On a page optimised for IE, I''d like to check if the browser type is other
than IE, so I can direct them to another page.

How can I modify the code below to redirect to indextext.asp if they aren''t
using IE? I''ve tried changing the = for <>, but get a syntax error.

Thanks

USER_AGENT = Request.ServerVariables("HTTP_USER_AGENT")
IS_IE = InStr(USER_AGENT,"MSIE")
if IS_IE then
response.redirect "indextext.asp"
end if

解决方案

"David" <da***@brown6669.freeserve.co.uk> wrote in message
news:5q**************@newsfep3-gui.server.ntli.net...

On a page optimised for IE, I''d like to check if the browser type is other
than IE, so I can direct them to another page.

How can I modify the code below to redirect to indextext.asp if they aren''t using IE? I''ve tried changing the = for <>, but get a syntax error.



I hope this is not for a public website... browser sniffing is bad practice.

Peter Foti


> I hope this is not for a public website... browser sniffing is bad
practice.

Why do you say that?

Bob Lehmann

"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message
news:10*************@corp.supernews.com...

"David" <da***@brown6669.freeserve.co.uk> wrote in message
news:5q**************@newsfep3-gui.server.ntli.net...

On a page optimised for IE, I''d like to check if the browser type is other than IE, so I can direct them to another page.

How can I modify the code below to redirect to indextext.asp if they aren''t

using IE? I''ve tried changing the = for <>, but get a syntax error.



I hope this is not for a public website... browser sniffing is bad


practice.
Peter Foti



The code you posted works fine on my machine, what specific syntax error are
you receiving?

"David" <da***@brown6669.freeserve.co.uk> wrote in message
news:5q**************@newsfep3-gui.server.ntli.net...

On a page optimised for IE, I''d like to check if the browser type is other
than IE, so I can direct them to another page.

How can I modify the code below to redirect to indextext.asp if they aren''t using IE? I''ve tried changing the = for <>, but get a syntax error.

Thanks

USER_AGENT = Request.ServerVariables("HTTP_USER_AGENT")
IS_IE = InStr(USER_AGENT,"MSIE")
if IS_IE then
response.redirect "indextext.asp"
end if



这篇关于检查浏览器是否不是I.E.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆