The use of W3C standards in Denmark
In Denmark, the Danish Ministry for Science, Technology and Innovation strongly encourage all governmental/national/municipal authorities to use W3C standards (HTML/XHTML standards) on their Web pages. This survey has run a test on 2033 danish authorities home pages. The testing tool was the W3C Validator. Only the main entrance page (start page) was tested. We assume, that webmasters has spend most time on this page. They have been reading about webdesign guidelines etc., before the main entrance page has been publish live for the public audience. The data from the survey was collected during January 31th until February 16th 2004.
Read the article in English or Danish
I followed a link to http://www.netsteder.dk ( part of Ministry for Science ) On Mozilla Firefox you can switch to an alternative stylesheet from the statusbar to get larger letters on the screen. This works well. But if you try to use the buttons on the right side of the screen to get some bigger letters nothing happens. (it works in IE)
If you go to http://www.netsteder.dk/omknapper.html there is more about the the bottons. It says it should work on Mozilla, but it doesn't. Anybody have a clue what is wrong?Comment by Jacob at March 8, 2004 12:10 PM | Permalink
Error: a.getAttribute("rel") has no properties
Source File: http://www.netsteder.dk/scripts/styleswitcher.js
A bit of testing reveals what that the problem is.
The script erroneously assumes that every link element will have a rel-attribute. This is not the case on the page in question, since one of the fist lines in the source reads:
(note "rev", not "rel").
The problem can be solved by replacing "a.getAttribute("rel").indexOf("style") != -1" with "a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1" all (3) places it occurs in the script code.Comment by Jens Gyldenkærne Clausen at March 8, 2004 02:09 PM | Permalink
If anyone is interested, I have uploadet a working example with the modified script: http://www.gyros.dk/usenet/html/styleskift.shtml
Argh! - I've just discovered that the html-code I entered in my first comment was "eaten" by the blog system. I would have thought that it was possible to enter html-codes here (and have them encoded serverside), but that is appearently not so. I can see that it is possible to encode the code when it is entered (writing < instead of < and > instead of >). Below is the missing code from before:
<LINK REV=MADE HREF="mailto:firstname.lastname@example.org">Comment by Jens Gyldenkærne Clausen at March 8, 2004 02:24 PM | Permalink
I just ckecked netsteder.dk .They have fixed the problem :-)Comment by Jacob Riis at March 11, 2004 11:27 PM | Permalink
Yes. I wrote to them after I had pinpointed the problem. Two days later (wednesday, 10. March) I got a friendly reply from netsteder.dk where a consultant promised to correct the problem. The corrected version is now online.
I have also contacted A List Apart, where the background article about the styleswitcher resides. I have recieved a single reply telling that
a) comments are disabled on older articles (the article is from 2001)
b) they normally doesn't update older articles.
They have mentioned a possibility to mark the article as "outdated information", to which I replied that the article isn't really outdated - the problem with the script has been there since the article was posted. Furthermore, the script in general is not at all bad - it can be useful to a lot of people. The only problem is that the script doesn't take into account that there may exist link-tags without rel-attributes. This can easily be corrected.
I haven't seen a response to my second mail.Comment by Jens Gyldenkærne Clausen at March 12, 2004 02:59 PM | Permalink
Thanks guys I was stuck trying to figure out how to fix this problem but good old google led me to you :)Comment by SlashEMc2k at February 27, 2006 11:24 AM | Permalink
Thank you too. I was led to you be searching on styleswitcher and "has no properties".Comment by Virignia Knight at February 6, 2007 01:29 PM | Permalink