views:

66

answers:

1

hi,

is there any Drupal module to display an alternative page in case Javascript is disabled ?

thanks

A: 

You should always make your website degrade gracefully. Since JavaScript happens on the client side, it is not something that you can check for on your server.

You can with js check if js is enabled and act upon it, but you would have to have the info before the page is displayed, if you want to display an alternative page. With caching etc, this would quickly become quite complex to manage.

googletorp
Maybe, instead of showing another page, I could hide some elements of the current one with css and then use javascript to display them ?
Patrick
@Patrick yeah that's a normal setup.
googletorp
ok cool. Still one question: when I load a new page, sometimes javascript is not fast enough to hide the element. I.e. I have a div with inside "Please enable Javascript" and I make it invisible with javascript, while showing the rest of the site. I sometimes see this <div> immediately after I visit the page.
Patrick
if it's not fast enough you can take a look at the noscript tag
googletorp

related questions