|
-
Oct 2nd, 2000, 04:23 AM
#1
Thread Starter
Evil Genius
Quick background info :
I am developing a vbs/web page which will be used as a personal site & will be the first full site I will have developed.
As it uses vbs, the user needs a version of IE to use & view it properly (not Netscape for example).
Problem :
Basically, I need some sample code in Javascript to :
1) Tell that the user is running IE.
2) If not, a messagebox appears telling them to get it
3) If so, navigate them to my starter page (i.e. - main.htm)
ANY help on this will be GREATLY appriciated. I do not want to learn another lanquage to vb (i.e. Java) as it may confuse me.
Thank you eveyone !
-
Oct 2nd, 2000, 10:56 AM
#2
Addicted Member
try this
Code:
<script Language="JavaScript">
<!--
var capable;
capable = (navigator.appName == "Microsoft Internet Explorer");
if (capable) {
response.redirect("homepage");
}
else{
alert("you need IE");
response.redirect("ie site");
}
-
Oct 3rd, 2000, 02:56 AM
#3
Thread Starter
Evil Genius
Wow 
Thank you for the quick reply jdavison ! Very much appriciated.
-
Oct 3rd, 2000, 03:48 AM
#4
Thread Starter
Evil Genius
Pain in the what ?
jdavison, one quick question, can I have a very simple example of how you would fit a message box or alert to appear instead of the re-direction below.
Thank you for all of your help!
-
Oct 3rd, 2000, 11:38 AM
#5
Addicted Member
just replace the redirect with the alert:
Code:
alert("your message here");
-
Oct 3rd, 2000, 03:36 PM
#6
Fanatic Member
just curious but why can't the user use netscape?
I allways use netscape and view asp pages often.
I may be mistaken but isn't asp made w/ vbs?
-
Oct 3rd, 2000, 03:55 PM
#7
Addicted Member
I dont believe netscape will handle client side vbscript. VbScript can be used instead of javascript on the client. I may be wrong on this.
-
Oct 3rd, 2000, 03:58 PM
#8
Addicted Member
Some more input
Alex,
You may want to just setup a simple page that runs just tat script and then redirects into your site. I have seen problems from trying to run VBscript and Javascript together on the same page.
-
Oct 3rd, 2000, 04:36 PM
#9
Fanatic Member
why use vbscript on the client?
I am new to this but why not use javascript on the client and vbscript on the server?
then both browser work for the same site.
-
Oct 4th, 2000, 03:07 AM
#10
Thread Starter
Evil Genius
OK people, this is what I am (trying to) acomplish...
- I heard that only Java works on netscape & not vbs. I don't want to learn java as I am concentrating on vb & don't want to confuse myself with another lanquage as from what I can see, vb goes into more or less everthing, games, web sites etc.
- Client / Server side just confuses the b@!locks off me, all I am trying to do here is a personal web page - not on a server that any idiot can look at, nothing special like a company page.
- This is the first page - purely Javascript to tell the user that if they have Netscape, my code won't work so come back when they have IE. This is the only page using the java bit, if the user has IE, then they are redirected to my fantastic site which purely uses vbs!
just to clear up few points there & bore you to death I thank you for all of your help everyone!
-
Oct 4th, 2000, 05:23 AM
#11
Thread Starter
Evil Genius
Whoops...
Hi everyone, I just cannot seen to get this one up & running, either with Jdavidson's code or my adapted :
Code:
<script Language="JavaScript">
<!--
var capable;
capable = (navigator.appName == "Microsoft Internet Explorer");
if (capable) {
response.redirect("www.microsoft.com");
}
else{
alert("The site has found that you are running an alternative to Microsoft's Internet Explorer" & Crlf & _
"This is essential to view this site as it is written in Visual Basic Script". & Crlf & _
"Please download this program at : http://www.microsoft.com/windows/ie/default.htm");
}
<!--######### DESIGNING #########-->
<HTML>
<HEAD>
<TITLE>ALEX'S HOME SITE</TITLE>
<FONT FACE="Comic Sans MS" SIZE=12>
Checking your browser configuration....
This should only take a few seconds.
</HEAD>
</HTML>
I don't think I have messed IE up, can anyone tell me what I have done wrong please?
Thank you for your patience.
-
Oct 4th, 2000, 09:07 AM
#12
Addicted Member
Try it like this
Code:
<!--######### DESIGNING #########-->
<HTML>
<HEAD>
<TITLE>ALEXS HOME SITE</TITLE>
<script Language="JavaScript">
<!--
var capable;
capable = (navigator.appName == "Microsoft Internet Explorer");
if (capable) {
response.redirect("www.microsoft.com");
}
else{
alert("The site has found that you are running an alternative to Microsoft's Internet Explorer" & Crlf & _
"This is essential to view this site as it is written in Visual Basic Script". & Crlf & _
"Please download this program at : http://www.microsoft.com/windows/ie/default.htm");
}
-->
</script>
</HEAD>
<BODY>
<FONT FACE="Comic Sans MS" SIZE=12>
Checking your browser configuration....
This should only take a few seconds.
</BODY>
</HTML>
-
Oct 4th, 2000, 10:31 AM
#13
Thread Starter
Evil Genius
Ok Now Thanks !
Thank you, all works now!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|