Opinion wanted on extent of use of scripts for site layout

I usually layout my sites with divs for title, menu, content (all in a wrapper div) so I can have site-wide structure, css menus, style, graphics etc.

Standard css stuff basically.

I’m just re-jigging things and something occurred to me, and this may be obvious to some of you but I’d never thought about it before.

Why not use JavaScript to render the div tags as well?

That way the only thing that’s in the html are declarations to scripts and the actual content text and image tags. I realise this is one step away from scripting the whole thing including content (but I don’t want to have content brought in from a database just yet) and I was wondering how widespread this practice is.

Thoughts?

A number of reasons not to are:

[list][]people who have deliberately disabled scripting for security reasons
[
]people who work where scripting is disabled due to work-place policy
[]people who are disabled and are using technology that doesn’t support scripting
[
]low-tech cell phones with internet support but no scripting
[*]search engines also ignore scripting too[/list]

In all of those cases, you end up finding that scripted content might as well not exist.

So, err, what is the point of JavaScript then? AJAX?

??confused??

Ajax is built on top of JavaScript, so the same issues apply.

The most effective way to use JavaScript, it to use it to enhance the user’s experience.

When you get to a point where what you’re doing just won’t work without JavaScript, you then find that your potential audience decreases due to the factors listed above.

Javascript should be an add on to make bells and whilstles for a site. The site should function without it, think of it as an extra thing for those who have it enabled.

Like air con. You need to make a car first, air con is an added extra, but some people like it.