...

View Full Version : ASK java script redirecting?



likon
07-13-2007, 04:41 AM
hi guys, I actually have no javascript knowledge at all but I need to do some redirecting stuff
<html>
<head>
<title> my domain.com : Redirecting... </title>
<script language="JavaScript">
var time=null
function move(){
window.location='http://www.mydomain.com'
}
<noscript>
Please enable your javascript in order to view this page properly...
</noscript>
</script>

</head>
<body onload="timer=setTimeout('move(),5000')">
<b>Redirecting to our dedicated server...</b><br>
If page does not load, please <a href="http://www.my domain.com">click here</a>
<body>
</html>
*********************************************************
the first thing is . I want to modify this script. this script is working already.
but I somehow feel unsatisfied.
let say we have visitor whose browser has java disabled.
then
this script will come up with the text:

Please enable your javascript in order to view this page properly...
Redirecting to our dedicated server...
If page does not load, please click here

I want to ONLY display Please enable your javascript in order to view this page properly ( without the text redirecting..blah bla blha. )

you know what I am saying?


oh ya. one more thing.
is there any html code to replace the text (REdirecting....) from
Left corner to center?

Thanks guys.

felgall
07-13-2007, 04:49 AM
So you just want to tell people without JavaScript to go away? If this is a commercial site then the first blind visitor you tell that to will have you in court for discriminating against them.

Redirects are best done server side either by setting a header record in a server side scripting language or by using a redirect statement in the .htaccess file.

glenngv
07-13-2007, 07:37 PM
If server-side is not available...

<html>
<head>
<title> my domain.com : Redirecting... </title>
<script type="text/javascript">
var time=null;
function move(){
window.location='http://www.mydomain.com';
}
</script>
</head>
<body onload="timer=setTimeout('move(),5000')">
<div>
<script type="text/javascript">
document.write('<div>Redirecting to our dedicated server...</div>');
document.write('If page does not load, please <a href="http://www.my domain.com">click here</a>');
</script>
<noscript>
Javascript is disabled, you have to manually <a href="http://www.my domain.com">click here</a> in order to view the page.
</noscript>
</div>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum