Use of DOM for dynamic pages accessible?
Anyone care to discuss or advise on the subject?
Browsers with JS disabled or not implemented, such as text browser, will certainly not able to recognize any JS commands.
The key to accessible scripting is making sure you are using JS to manipulate EXISTING content. In order to make your example accessible you have several options:
1. Simple but may not be optimal:
HTML page contains complete text of all articles that can be seen by those with JS disabled. Using the page onload event, you add an element after the first/second paragraph of each article that says "Read the rest" and use its onclick event to show/hide the rest of the article.
2. More complicated, but reduces bandwidth:
HTML page contains first few paragraphs of each article with the link to a separate page representing complete article at the end. That becomes the default behaviour for JS disabled browsers. When JS is enabled you use bode onload event to replace those links with an element that is consequently used to show/hide the rest of the content and then upload the rest of the content in the background.
Working web site is not the one that looks the same in a few graphical browsers, but the one that adequately delivers its content to any device accessing it.
Ah some good ieas. Thanks for the suggestions man. I think I'd better give both a test to see which one would work out best in the end really. I still want each story to be able to be bookmarked by URI too which I would imagine is going to cause me a considerable amount of trouble too. I think I've got enough to get started and experiment around a bit first though.
When making a DOM script like that, you have to lay down the basic HTML first then build the script on top of it.
Take this for example, I made it for someone on the forums a while ago. The HTML is pretty simple but then with the aid of some onclick commands and some nifty DOM-ing, a thumbnail viewer is created (not too dis-similar to the preview article viewer you're after).
Every fight is a food fight when you’re a cannibal.
You may be interested in the following A List Apart article: Let Them Eat Cake
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)