Accessibility
< Continued from page 3
A good indication of those things that used to be done in HTML but which should be done using stylesheets or JavaScript can be found by examining the list of those HTML tags and attributes that have been deprecated. Being deprecated means that they have been flagged for removal from HTML because they are no longer required. This includes such tags as <font> and <center> and attributes such as align= which should now be handled with stylesheets as well as behavioural type attributes such as target= which should be replaced with JavaScript or better yet left for your visitors to decide for themselves.
Most web browsers now support the opening of multiple tabs in the one browser window. The target attribute along with the JavaScript equivalent allow you to suggest opening a new browser window but provide no way of requesting opening a new tab. As in many cases your visitors will prefer to have the new page open either in the same tab or a new tab in the existing browser window and to not open a new browser window, forcing the page to open in a new window will just get them annoyed at you and they will leave your site more quickly.
The HTML contains the content that your visitors are visiting your site in order to read. The JavaScript that you add to your web page should be designed to enhance their experience of your site by making your site easier to use. The JavaScript should not be used to try to force your opinion on what they should be allowed to do with your page on them. They are viewing your page in their browser and are entitled to have their browser work the way that they have it configured to work without any attempted interference from the web page being viewed.
If you do attempt such interference then you will either drive your visitors away from your site or, in the case of the more knowledgeable ones, they will reconfigure their browser to override your script so that the pages work the way that they want them to.
The ideal way of linking the HTML, stylesheet, and JavaScript files together so that the web browser has access to all three to define the content, appearance, and behaviour of the web page that is being viewed is the one that we are using in all of the scripts in this book.
We place one or more <script> elements and one or more <link> elements into the head of our page to identify the JavaScript and stylesheet files that are to be downloaded with the page and used with it.
Doing it this way means that the same JavaScript and stylesheet files can be used by multiple pages on the site while only needing to be downloaded once. It also means that the HTML file has as little information in it that is not directly related to the actual content of the page as possible. This should give us an advantage over other sites with similar content that is diluted with appearance and behaviour codes in terms of the search engine ranking that our page should achieve.
A good indication of those things that used to be done in HTML but which should be done using stylesheets or JavaScript can be found by examining the list of those HTML tags and attributes that have been deprecated. Being deprecated means that they have been flagged for removal from HTML because they are no longer required. This includes such tags as <font> and <center> and attributes such as align= which should now be handled with stylesheets as well as behavioural type attributes such as target= which should be replaced with JavaScript or better yet left for your visitors to decide for themselves.
Most web browsers now support the opening of multiple tabs in the one browser window. The target attribute along with the JavaScript equivalent allow you to suggest opening a new browser window but provide no way of requesting opening a new tab. As in many cases your visitors will prefer to have the new page open either in the same tab or a new tab in the existing browser window and to not open a new browser window, forcing the page to open in a new window will just get them annoyed at you and they will leave your site more quickly.
The HTML contains the content that your visitors are visiting your site in order to read. The JavaScript that you add to your web page should be designed to enhance their experience of your site by making your site easier to use. The JavaScript should not be used to try to force your opinion on what they should be allowed to do with your page on them. They are viewing your page in their browser and are entitled to have their browser work the way that they have it configured to work without any attempted interference from the web page being viewed.
If you do attempt such interference then you will either drive your visitors away from your site or, in the case of the more knowledgeable ones, they will reconfigure their browser to override your script so that the pages work the way that they want them to.
Linking Them Together
The ideal way of linking the HTML, stylesheet, and JavaScript files together so that the web browser has access to all three to define the content, appearance, and behaviour of the web page that is being viewed is the one that we are using in all of the scripts in this book.
We place one or more <script> elements and one or more <link> elements into the head of our page to identify the JavaScript and stylesheet files that are to be downloaded with the page and used with it.
Doing it this way means that the same JavaScript and stylesheet files can be used by multiple pages on the site while only needing to be downloaded once. It also means that the HTML file has as little information in it that is not directly related to the actual content of the page as possible. This should give us an advantage over other sites with similar content that is diluted with appearance and behaviour codes in terms of the search engine ranking that our page should achieve.
Source...