SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Aug 5, 2002, 07:06 #1
- Join Date
- Jan 2001
- Location
- earth
- Posts
- 501
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
why? but why this code is not working?
Well... this code had work last year. But after my computer had problems....it didn't work anymore.
Hello!
This code above detects the browser and directs to INDEX.ASP
The problem is that it doesn't go to the . ASP.
<html>
<head>
<title>.</title>
<script language=JavaScript>
function executar ()
{
if (document.all)
{
browser="ie"
}
else if (document.layers)
{
browser="netscape"
}
else if (document.getElementById? 1:0)
{
browser="NN6"
}
else
{
browser="others"
}
document.cookie="Plataforma=" + window.navigator.platform;
document.cookie="Browser=" + browser;
document.location.href="index.asp"
}
</head>
<body onLoad=executar()>
</body>
</html>
WHAT'S HAPPENNING?
On the IE the pages is grey. On the Netscape the code appears on the browser. And it doesn't go to the INDEX. ASP.
Bye:::::::::::::::::::::::
-
Aug 5, 2002, 07:25 #2
- Join Date
- Jun 2002
- Location
- .chicago.il.us
- Posts
- 957
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You have a few errors in there, the worst of which is forgetting the closing </script> tag.
Try this:
Code:<head> <title>.</title> <script type="text/javascript"> function executar() { if(document.all){ browser = 'ie'; }else if(document.layers){ browser = 'netscape'; }else if(document.getElementById){ browser = 'NN6'; }else{ browser = 'others'; } document.cookie = 'Plataforma=' + window.navigator.platform; document.cookie = 'Browser=' + browser; window.location = 'index.asp'; } </script> </head> <body onload="executar()"> </body> </html>
----Adopt-a-Sig----
Your message here!
-
Aug 5, 2002, 07:37 #3
- Join Date
- Jan 2001
- Location
- earth
- Posts
- 501
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I LOVE YOU!!!!!
I've just closed the script!!!And guess?
It works!! OH!! What a stupid girl I'm.
-
Aug 5, 2002, 08:21 #4
- Join Date
- Feb 2002
- Location
- Gatwick, UK
- Posts
- 1,206
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes you are
No sympathy here
Flawless---=| If you're going to buy a pet - get a Shetland Giraffe |=---
-
Aug 5, 2002, 08:58 #5
- Join Date
- Jun 2002
- Location
- .chicago.il.us
- Posts
- 957
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by magi
I LOVE YOU!!!!!
Hmmm.... That's the first time it was my brain that a gal loved.----Adopt-a-Sig----
Your message here!
-
Aug 5, 2002, 09:34 #6
- Join Date
- Jan 2001
- Location
- earth
- Posts
- 501
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by Flawless_koder
Yes you are
No sympathy here
Flawless
Bookmarks