Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirect if javascript is not enabled

Status
Not open for further replies.

gameon

Programmer
Feb 23, 2001
325
0
0
GB
Hi, is it possible to redirect to a page if javascript is not enabled?

I thought about adding a flash redirect in some <noscript> tags, but would prefer not to use flash.

Is there another way...

Cheers,

M@
 
try this . . .

replace the *** with the URL you want to direct to.


<noscript>
<meta http-equiv=&quot;refresh&quot; content=&quot;0; URL=***&quot;>
</noscript>
 
Cheers, I thought we'd be stuck there...

Thanks!

M@
 
gameon,

PapaGLP's code will redirect regardless if javascript is enabled or not. a simple solution may be to redirect js-enabled browsers to your javascript page, and leave non-js browsers on the original page:

non-js page:

<head>
<script language=&quot;javascript&quot;>
location.href = &quot;jsEnabled.html&quot;;
</script>
</head>
<body>
Your browser does not have javascript enabled.
</body>
</html>

======================================

if (!succeed) try();
-jeff
 
Cheers Jeff, we were planning just to SS include

<noscript><meta http-equiv=&quot;refresh&quot; content=&quot;0; URL=noscrpt.htm&quot;></noscript> in a line of the header of every page...

What do you think?

M@
 
The code i gave only will redirect if the user's browser doesn't have JS enabled. Otherwise, the <noscript></noscript> contents are ignored. gameon, the code you just listed works fine, i have it utilized throughout my site now
 
true...I ignored the <noscript> tags myself. ======================================

if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top