Konqueror and Safari [KHTML] incorrectly only populate the document.styleSheets collection with stylesheets that are enabled at any particular instant. The stylesheets cannot be disabled from here, and do not have the title property.
Bummer. However, as is common with many things programmatic, all is not entirely lost. The article goes on to say that even if the document.styleSheets collection is not supported (or improperly supported) it still may be possible to get an equivalent disabling or switching action by referencing the <link> and <style> tags instead. This isn't the W3C recommended way of doing things, but you need to work with what you got. Half way is better than no way, I suppose. The most usable bit of scripting my friend John Charlton and I have been able to jury rig so far will toggle linked stylesheets, but not inline stylesheets - those confined within the <style> tags or using @import.
Toggle Linked CSSWell, it's a start. And to be completely honest, John hacked it together - I just made it look pretty. What else is new? Additional contributions and tweakage will be gratefully accepted. Now, if you don't mind, I'm off to drop a couple of very specific bug fix request into Dave Hyatt's mailbox.
Subscribe to posts (RSS)
Subscribe to available domain name of the week (RSS)
Subscribe to available domain name of the week (Atom)
ISSN 1496-3221
Copyright © 1996-2012 Grant Hutchinson
Post a Comment