PDA

View Full Version : Redirecting if JS is off



Keleth
08-13-2009, 07:08 PM
Hey all,

Does anyone know if there is an effective way to redirect is JS is off? I was thinking of something like


<noscript>
<meta http-equiv="refresh" content="0; URL=http://www.mydoman.com/jsOff.php">
</noscript>

However, I was told by someone I should avoid meta refreshes and use PHP. I'm not sure how a server side code is supposed to make a client side reaction. Thoughts?

Schmoopy
08-13-2009, 07:46 PM
If you want to do it with PHP then the code for it is:



<?php header("Location: http://www.yoursite.com/page.html"); ?>


But doing a meta refresh is fine so far as I know.

Keleth
08-13-2009, 07:58 PM
If you want to do it with PHP then the code for it is:



<?php header("Location: http://www.yoursite.com/page.html"); ?>


But doing a meta refresh is fine so far as I know.


Right, but that wouldn't actually check for JS or not.

Schmoopy
08-13-2009, 08:03 PM
But you could just leave it all to PHP, with there not being a need to check for JS, since PHP will work with or without it.

Keleth
08-13-2009, 08:11 PM
But you could just leave it all to PHP, with there not being a need to check for JS, since PHP will work with or without it.

Well, my concern is not to redirect, but to redirect if JS is off.