带有浏览器嗅探器的asp页面在Netscape中不起作用 [英] asp page with browser sniffer doesn't work in Netscape

查看:53
本文介绍了带有浏览器嗅探器的asp页面在Netscape中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我在asp页面中有以下代码。当我在IE或Opera中运行此页面时,

正确显示标题信息并且不会将我重定向到''test.html''。

但是,当我运行时这在Netscape中直接进入重定向页面

''test.html''表示javascript未启用,它也会显示

不显示标题信息。有人能告诉我为什么会这样吗?


<%@ Language = VBScript%>

<%''获取标题信息
Response.Write Request.ServerVariables(" HTTP_USER_AGENT")

''检测javascript

设置bc = Server.CreateObject(" MSWC.BrowserType")%>

浏览器名称:<%= bc.browser%>

浏览器版本:<%= bc.version%>


<%

if(bc.javascript = FALSE)then

response.write(" no javascript")

response.Redirect(" Test.html")

else

response.write(" has javascript")


结束如果

设置bc =无

%>

解决方案

并不是说任何人都使用Netscape,但这是一种非常愚蠢的方式来测试用户是否启用了JavaScript,无论如何都要测试。你正在测试的是

,他们使用的浏览器*支持* JavaScript。他们可以很容易地把它关掉,而你正在做的测试仍然会通过。

http://www.aspfaq.com/2058


-
http://www.aspfaq.com/

(反向回复地址。)


" AMC" < AB ***** @ netgate.net>在消息中写道

news:uF ************** @ TK2MSFTNGP12.phx.gbl ...


我在asp页面中有以下代码。当我在IE或Opera
中运行此页面时,它会正确显示标题信息,并且不会将我重定向到
''test.html''。但是,当我在Netscape中运行它时,它直接进入重定向页面
''test.html'',表示javascript未启用,而且
也不显示标题信息。有人能告诉我为什么会这样吗?

<%@语言= VBScript%>
<%''获取标题信息
Response.Write Request.ServerVariables( " HTTP_USER_AGENT")
''检测javascript
设置bc = Server.CreateObject(" MSWC.BrowserType")%>
浏览器名称:<%= bc 。浏览器浏览器版本:<%= bc.version%>

<%
如果(bc.javascript = FALSE)那么
response.write(" no javascript")
response.Redirect(" Test.html")

response.write(" has javascript")

结束如果
设置bc =没有
%>



嗯,


我的很多用户仍然拥有Netscape,所以这需要工作。我已经在Netscape中启用了
JavaScript,但是asp页面重定向到了测试页面的

,表明它没有启用或*支持*。你有没有b $ b有关于这个问题的任何有效信息?

" Aaron [SQL Server MVP]" < TE ***** @ dnartreb.noraa>在消息中写道

新闻:例如**************** @ TK2MSFTNGP10.phx.gbl ...

不是那个人再使用Netscape,但无论如何,这是一种非常愚蠢的方式来测试用户是否启用了JavaScript。您正在测试
的所有内容是他们使用的浏览器*支持* JavaScript。他们可以轻松地关闭它,你正在进行的测试仍然会通过。

http://www.aspfaq.com/2058

http://www.aspfaq.com/
(反向回复地址。)


" AMC" < AB ***** @ netgate.net>在消息中写道
新闻:uF ************** @ TK2MSFTNGP12.phx.gbl ...


我在asp页面中有以下代码。当我在IE中运行此页面或
Opera

时,

正确显示标题信息并且不会将我重定向到


' 'test.html''。

但是,当我在Netscape中运行它时,它直接进入重定向



page''test。 html''表示javascript未启用,而且


不显示标题信息。有人能告诉我为什么会这样吗?

<%@语言= VBScript%>
<%''获取标题信息
Response.Write Request.ServerVariables( " HTTP_USER_AGENT")
''检测javascript
设置bc = Server.CreateObject(" MSWC.BrowserType")%>
浏览器名称:<%= bc 。浏览器浏览器版本:<%= bc.version%>

<%
如果(bc.javascript = FALSE)那么
response.write(" no javascript")
response.Redirect(" Test.html")

response.write(" has javascript")

结束如果
设置bc =无
%>



您看到我发布的链接了吗?使用JAVASCRIPT来确定JavaScript是否支持
,而不是一些愚蠢的浏览器功能对象,它只告诉你支持JavaScript支持
。你是否仅根据他们在简历上说的话,或者只有在他们真正证明他们能够按照他们的说法做到的话后才能雇佣他们?


-
http:// www。 aspfaq.com/

(反向地址回复。)


" AMC" < AB ***** @ netgate.net>在消息中写道

新闻:#R ************** @ TK2MSFTNGP12.phx.gbl ...

嗯,

我的很多用户仍然拥有Netscape,所以这需要工作。我在Netscape中启用了JavaScript,但asp页面重定向到测试页面,表明它未启用或*支持*。你有没有关于这个问题的任何有效信息?

" Aaron [SQL Server MVP]" < TE ***** @ dnartreb.noraa>在消息中写道
新闻:例如**************** @ TK2MSFTNGP10.phx.gbl ...

并非所有人都使用Netscape,但无论如何,这是一种非常愚蠢的方式来测试用户是否启用了JavaScript。您正在测试的所有


他们正在使用*支持* JavaScript的浏览器。他们可以轻松

关闭它,你正在进行的测试仍然会通过。

http://www.aspfaq.com/2058

-
http://www.aspfaq.com/
(反向地址回复。)


AMC < AB ***** @ netgate.net>在消息中写道
新闻:uF ************** @ TK2MSFTNGP12.phx.gbl ...


我在asp页面中有以下代码。当我在IE中运行此页面或


Opera

正确显示标题信息并且不会将我重定向到


''test.html''。

但是,当我在Netscape中运行它时,它直接进入重定向


页面''test.html''表示javascript未启用,而且


不显示标题信息。有人可以告诉我为什么这是
发生吗?
<%@语言= VBScript%>
<%''获取标题信息
Response.Write Request.ServerVariables( " HTTP_USER_AGENT")
''检测javascript
设置bc = Server.CreateObject(" MSWC.BrowserType")%>
浏览器名称:<%= bc 。浏览器浏览器版本:<%= bc.version%>

<%
如果(bc.javascript = FALSE)那么
response.write(" no javascript")
response.Redirect(" Test.html")

response.write(" has javascript")

结束如果
设置bc =无
%>




Hi,

I have the below code in an asp page. When I run this page in IE or Opera it
correctly displays the header info and does not redirect me to ''test.html''.
However, when I run this in Netscape it goes straight to the redirect page
''test.html'' which indicates that javascript is not enabled and it also does
not display the header info. Can someone tell me why this is happening?

<%@ Language=VBScript%>
<%''get header info
Response.Write Request.ServerVariables("HTTP_USER_AGENT")

''detect javascript
Set bc = Server.CreateObject("MSWC.BrowserType") %>
Browser Name: <%=bc.browser %>
Browser Version: <%=bc.version%>

<%
if (bc.javascript = FALSE) then
response.write("no javascript")
response.Redirect("Test.html")
else
response.write("has javascript")

end if
set bc=nothing
%>

解决方案

Not that anyone uses Netscape anymore, but this is a pretty silly way to
test whether a user has JavaScript enabled, anyway. All you are testing is
that they are using a browser that *supports* JavaScript. They can easily
turn it off, and the test you are doing will still pass.

http://www.aspfaq.com/2058

--
http://www.aspfaq.com/
(Reverse address to reply.)


"AMC" <ab*****@netgate.net> wrote in message
news:uF**************@TK2MSFTNGP12.phx.gbl...

Hi,

I have the below code in an asp page. When I run this page in IE or Opera it correctly displays the header info and does not redirect me to ''test.html''. However, when I run this in Netscape it goes straight to the redirect page
''test.html'' which indicates that javascript is not enabled and it also does not display the header info. Can someone tell me why this is happening?

<%@ Language=VBScript%>
<%''get header info
Response.Write Request.ServerVariables("HTTP_USER_AGENT")

''detect javascript
Set bc = Server.CreateObject("MSWC.BrowserType") %>
Browser Name: <%=bc.browser %>
Browser Version: <%=bc.version%>

<%
if (bc.javascript = FALSE) then
response.write("no javascript")
response.Redirect("Test.html")
else
response.write("has javascript")

end if
set bc=nothing
%>



Well,

Plenty of my users still have Netscape so this needs to work. I have
JavaScript enabled in Netscape but the asp page is redirecting to
the test page which indicates that it is not enabled or *supported*. Do you
have any valid information relating to this problem?
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:eg****************@TK2MSFTNGP10.phx.gbl...

Not that anyone uses Netscape anymore, but this is a pretty silly way to
test whether a user has JavaScript enabled, anyway. All you are testing is that they are using a browser that *supports* JavaScript. They can easily
turn it off, and the test you are doing will still pass.

http://www.aspfaq.com/2058

--
http://www.aspfaq.com/
(Reverse address to reply.)


"AMC" <ab*****@netgate.net> wrote in message
news:uF**************@TK2MSFTNGP12.phx.gbl...

Hi,

I have the below code in an asp page. When I run this page in IE or Opera

it

correctly displays the header info and does not redirect me to


''test.html''.

However, when I run this in Netscape it goes straight to the redirect


page ''test.html'' which indicates that javascript is not enabled and it also


does

not display the header info. Can someone tell me why this is happening?

<%@ Language=VBScript%>
<%''get header info
Response.Write Request.ServerVariables("HTTP_USER_AGENT")

''detect javascript
Set bc = Server.CreateObject("MSWC.BrowserType") %>
Browser Name: <%=bc.browser %>
Browser Version: <%=bc.version%>

<%
if (bc.javascript = FALSE) then
response.write("no javascript")
response.Redirect("Test.html")
else
response.write("has javascript")

end if
set bc=nothing
%>




Did you see the link I posted? Use JAVASCRIPT to determine if JavaScript is
enabled, not some stupid browser capabilities object that merely tells you
that JavaScript is SUPPORTED. Do you hire people based solely on what they
say on their resume, or only after they''ve actually demonstrated that they
can do what they say they can?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"AMC" <ab*****@netgate.net> wrote in message
news:#R**************@TK2MSFTNGP12.phx.gbl...

Well,

Plenty of my users still have Netscape so this needs to work. I have
JavaScript enabled in Netscape but the asp page is redirecting to
the test page which indicates that it is not enabled or *supported*. Do you have any valid information relating to this problem?
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:eg****************@TK2MSFTNGP10.phx.gbl...

Not that anyone uses Netscape anymore, but this is a pretty silly way to
test whether a user has JavaScript enabled, anyway. All you are testing


is

that they are using a browser that *supports* JavaScript. They can easily

turn it off, and the test you are doing will still pass.

http://www.aspfaq.com/2058

--
http://www.aspfaq.com/
(Reverse address to reply.)


"AMC" <ab*****@netgate.net> wrote in message
news:uF**************@TK2MSFTNGP12.phx.gbl...

Hi,

I have the below code in an asp page. When I run this page in IE or


Opera

it

correctly displays the header info and does not redirect me to


''test.html''.

However, when I run this in Netscape it goes straight to the redirect


page ''test.html'' which indicates that javascript is not enabled and it also


does

not display the header info. Can someone tell me why this is happening?
<%@ Language=VBScript%>
<%''get header info
Response.Write Request.ServerVariables("HTTP_USER_AGENT")

''detect javascript
Set bc = Server.CreateObject("MSWC.BrowserType") %>
Browser Name: <%=bc.browser %>
Browser Version: <%=bc.version%>

<%
if (bc.javascript = FALSE) then
response.write("no javascript")
response.Redirect("Test.html")
else
response.write("has javascript")

end if
set bc=nothing
%>





这篇关于带有浏览器嗅探器的asp页面在Netscape中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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