How to find javascript is disabled or enabled?

Hi,

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




<noscript>

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

</noscript>



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.

Thanks

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 www.blabla.com/my_error_page/

Any try to access the page will be redirected.

Thanks

but code please

<noscript>

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

</noscript>