How to find javascript is disabled or enabled?


How to find javascript is disabled in our page and then

if javascript is disabled then how to redirect to a page to show javascript is disabled

Simply put this in your html head


	<?php echo CHtml::metaTag('0;url='.CHtml::normalizeUrl(array('page/javascript')),null,'refresh'); ?>


where page/javascript can be replace by the redirected page you want. But try not put it in the layout if the page you are redirecting is using the same layout. Because the redirecting will be recursive.


i use all the pages displayed in main.php of layout (default)

as your thougt recursive occurs,

so how prevent it and how to create another layout to apply it

You should create a especific page with this "error". Like 404, 500.

Redirect the user to

Any try to access the page will be redirected.


but code please


<META HTTP-EQUIV=Refresh CONTENT="1;URL=myUrlWithJavascriptMessage.html">