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
%> 13 2051
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 %>
Duh,
Yes I saw the link you posted, and I am well aware of Browserhawk etc. For
reasons that I won't waste my time explaining again JAVASCRIPT is not an
option.
For your info, the only 'stupidity' is in your inane replies to my post. Who
I hire has no relevance to this thread, but since your asked
I wouldn't hire you because you have clearly demonstrated that you don't
know squat!
Keep posting, and I'll keep laughing!!!
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:%2******************@tk2msftngp13.phx.gbl... 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 > %> > > > > >
Wow, you're a bad programmer AND an a**hole. Good job.
*PLONK*
"AMC" <ab*****@netgate.net> wrote in message
news:#z**************@TK2MSFTNGP15.phx.gbl... Duh,
Yes I saw the link you posted, and I am well aware of Browserhawk etc. For reasons that I won't waste my time explaining again JAVASCRIPT is not an option.
For your info, the only 'stupidity' is in your inane replies to my post.
Who I hire has no relevance to this thread, but since your asked I wouldn't hire you because you have clearly demonstrated that you don't know squat!
Keep posting, and I'll keep laughing!!!
>>For reasons that I won't waste my time explaining again JAVASCRIPT is not
an option.
Again? I can't find where you explained it once.
Bob Lehmann
"AMC" <ab*****@netgate.net> wrote in message
news:#z**************@TK2MSFTNGP15.phx.gbl... Duh,
Yes I saw the link you posted, and I am well aware of Browserhawk etc. For reasons that I won't waste my time explaining again JAVASCRIPT is not an option.
For your info, the only 'stupidity' is in your inane replies to my post.
Who I hire has no relevance to this thread, but since your asked I wouldn't hire you because you have clearly demonstrated that you don't know squat!
Keep posting, and I'll keep laughing!!!
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:%2******************@tk2msftngp13.phx.gbl... 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 > > %> > > > > > > > > > > > >
The only question I need answered is why doesn't this script work in
Netscape:
<%@ 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 > > > %>
"Bob Lehmann" <none> wrote in message
news:Ob****************@TK2MSFTNGP15.phx.gbl...For reasons that I won't waste my time explaining again JAVASCRIPT is
not an option. Again? I can't find where you explained it once.
Bob Lehmann
"AMC" <ab*****@netgate.net> wrote in message news:#z**************@TK2MSFTNGP15.phx.gbl... Duh,
Yes I saw the link you posted, and I am well aware of Browserhawk etc.
For reasons that I won't waste my time explaining again JAVASCRIPT is not an option.
For your info, the only 'stupidity' is in your inane replies to my post. Who I hire has no relevance to this thread, but since your asked I wouldn't hire you because you have clearly demonstrated that you don't know squat!
Keep posting, and I'll keep laughing!!!
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message news:%2******************@tk2msftngp13.phx.gbl... 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 > > > %> > > > > > > > > > > > > > > > > > > > > >
AMC wrote: if (bc.javascript = FALSE) then response.write("no javascript") response.Redirect("Test.html")
Response.Write and Response.Redirect are incompatible:
"Any response body content such as displayed HTML text or
Response.Write text in the page indicated by the original
URL is ignored." http://msdn.microsoft.com/library/en...om_resomre.asp
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Rasta wrote: The only question I need answered is why doesn't this script work in Netscape:
Among other things, because it is being interpreted by IIS (on the server
side), not by Netscape. But let's break it down:
<%@ Language=VBScript%>>>> <%'get header info >>> Response.Write Request.ServerVariables("HTTP_USER_AGENT") >>> >>> 'detect javascript >>> >>> <% >>> Browser Name: <%=bc.browser %> >>> Browser Version: <%=bc.version%> >>> set bc=nothing >>> >>> %>
All of the above is immaterial to your question. Leave it out of your post. Set bc = Server.CreateObject("MSWC.BrowserType") >>> if (bc.javascript = FALSE) then >>> response.write("no javascript") >>> response.Redirect("Test.html") >>> else >>> response.write("has javascript") >>> end if
The problem with your above approach is that it will not work as expected
unless you keep your browsercap.ini file updated. You will eventually come
to understand that this is more trouble than it is worth, so STOP USING
MSWC.BrowserType NOW. http://aspfaq.com/show.asp?id=2199
Once you come to terms with this, you should come back and apologize to
Aaron. His initial response was helpful and to the point.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
AMC wrote: Well,
Plenty of my users still have Netscape so this needs to work.
The latest figures I saw suggest that less than 1.5% of users overall
are using Netscape, and that figure is on a steady decline: http://www.w3schools.com/browsers/browsers_stats.asp
So, apart from the very valid points made by Aaron, if you are spending
more than 1.4% of your project development time on this problem, it
would be time wasted in my book.
Morris
Morris wrote: The latest figures I saw suggest that less than 1.5% of users overall are using Netscape, and that figure is on a steady decline: http://www.w3schools.com/browsers/browsers_stats.asp So, apart from the very valid points made by Aaron, if you are spending more than 1.4% of your project development time on this problem, it would be time wasted in my book.
He did not say which version of Netscape. Since all versions over 5 are
built on the Gecko engine, this could represent as much as 23.9% of the
market (Firefox + Mozilla + Netscape 7), according to the January 2005
figures on your referenced site. And the share of Gecko-based browsers has
been growing every month for at least a year.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Dave Anderson wrote: Morris wrote:
The latest figures I saw suggest that less than 1.5% of users overall are using Netscape, and that figure is on a steady decline: http://www.w3schools.com/browsers/browsers_stats.asp So, apart from the very valid points made by Aaron, if you are spending more than 1.4% of your project development time on this problem, it would be time wasted in my book.
He did not say which version of Netscape. Since all versions over 5 are built on the Gecko engine, this could represent as much as 23.9% of the market (Firefox + Mozilla + Netscape 7), according to the January 2005 figures on your referenced site. And the share of Gecko-based browsers has been growing every month for at least a year.
It could represent that number - true. However, since the OP referred to
"Netscape", as opposed to "Mozilla" or "Firefox", I assumed he was
referring to the versions that are declining.
Just goes to illustrate that posters should ensure that they include
*all* relevant information, including version numbers (and that those
trying to reply shouldn't make assumptions - even though they may appear
valid assumptions).
Morris
Gazing into my crystal ball I observed "AMC" <ab*****@netgate.net>
writing in 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 %>
In addition to what others have said, browser sniffing is not going to do
you any good. One of reasons is that there are many, many browsers out
there with many different engines, different capabilities, etc. Some
browsers will identify themselves as other than what they are, Opera for
example. Users can also turn javascript off if they so desire.
So the only true way to test for javascript is something like:
<head>
<script type="text/javascript">
location.href="somepage.htm"
</script>
</head>
<body>
<p>Your browser does not seem to have javascript enabled. Please check your
browsers documentation to see if it is available and how to enable it.</p>
Now, if the user never sees the above paragraph, then they have javascript
enabled, otherwise, they don't. Simple.
--
Adrienne Boswell http://www.cavalcade-of-coding.info
Please respond to the group so others can share This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mr. x |
last post by:
Hello,
I wrote a javascript,
and when I open the html by the browser,
I get the message : Error in page.
It is about tousand lines, and I cannot figure out in a simple way,
where is the...
|
by: SoloCDM |
last post by:
How do I keep my entire web page at a fixed width?
*********************************************************************
Signed,
SoloCDM
|
by: AMC |
last post by:
Hi,
I need to code an asp based browser sniffer. It needs to detect if a browser
can support css and if not redirect to a different site. Does anyone have
sample code that does this?
thx
|
by: Keyser |
last post by:
On most my pages, I use Javascript to play a sound. It works fine in
Netscape 4.7, Netscape 7.2, Firefox 1.0, IE5 and IE6 using Windows98 as
the operating system. However, using WindowsXP as the...
|
by: Johnny |
last post by:
How do I create a link on a Web page on my hard drive that will run an
executable file on my hard drive?
For example, let's say I create runpoodle.htm and save it to my hard
drive, and let's...
|
by: trpost |
last post by:
I am looking for a script using javascript to pull browser information
including, browser type and version, OS info, plugins (flash, acrobat,
media player, etc), java version, etc. that will work...
|
by: Guern1 |
last post by:
Hi
Need a bit of help here please to point me in the right direction.
I have a java class file here which i wish from a menu item to open a web page which contains a help page.
]
} else...
|
by: Guern1 |
last post by:
Hi
Sorry if I have posted this to the wrong forum.
Need a bit of help here please to point me in the right direction.
I have a java class file here which i wish from a menu item to open a...
|
by: YaoBao |
last post by:
Is any ColdFusion script I can put on my webpage that will create a search bar so people can type keywords to match it on the current page in my website? It will be exactly like the finder search bar...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |