Help w/a script, pls

S

Sonia

Hi,

I've www.maindomain.com/client which redirects the user to an other domain
using the script below.

I'd like to add an If statement to the same script that when the server
hosting www.mydomain.com is not available, the client is sent to
www.maindomain.com/sysdown.htm.

Can it be done and if so, how?

TIA

Sonia



<head>

<script>



var browser_type=navigator.appName

var browser_version=parseInt(navigator.appVersion)



//if NS 6

if (browser_type=="Netscape"&&browser_version>=5)

window.location.replace("http:// www.mydomain.com")

//if IE 4+

else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)

window.location.replace("http:// www.mydomain.com ")

//if NS4+

else if (browser_type=="Netscape"&&browser_version>=4)

window.location.replace("http:// www.mydomain.com ")

//Default goto page (NOT NS 4+ and NOT IE 4+)

else

window.location="http://www.mydomain.com"

</script>

</HEAD>
 
K

Kevin Spencer

Hi sonia,

No, it can't be done. Once the browser is redirected, it is no longer even
looking at this page, nor the script in it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
 
K

Kevin Spencer

It can be done but not with client side code.

Yeah, now that you mention it, Mike, you could do it with ASP or ASP.Net.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
 
S

Sonia

Thank you.
How about a code which checks for the redirected address? If it cannot be
done after, how about before?
 
K

Kevin Spencer

Not on the client side.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top