Elegant solution to no javascript

222 views Asked by At

So I have created a jquery dropdown which looks nice but now I need to handle the noscript users. With Javascript turned off my div is still there and is also displays the alternative bog standard select box.

I am looking for an elegant solution to remove all jquery enalbled content, (with css?) and replace them with more baisc HTML.

3

There are 3 answers

1
Lazarus On

You are approaching the problem from the wrong direction. You should start with basic HTML and then apply progressive enhancements through javascript/jQuery/etc. Using that model you will always have the fall back of 'javascript disabled' with a workable interface.

Trying to work backward from a 'bells and whistles' interface is doubly hard.

If there are additional HTML entities required for your enhanced interface then the best thing is to set them to "display: none" and reveal them using javascript/jQuery/etc.

0
Ivan On

I would recommend you to go other way round. First you develop the page without jquery content. The page should use just standard html elements. And then you use jQuery to extend them(eg. change standard dropdown with jQuery one).

0
TNC On

Agree with Lazarus. To help you with your drop-down, you can use css ":hover" to achieve some hiding and revealing using no JS.