I'm trying to validate a webpage that is otherwise xhtml 1.0 strict, apart from a <noscript><link rel=" " /></noscript> line.
This line is fairly important as it links in a fallback stylesheet should a javascript impaired browser visit the page and fail to operate the popout menu properly.
Is there a workaround for this?
<noscript> problem
I'd look at it from the other direction. If you don't mind using document.write then I'd have that write your JS stylesheets in the document head after your normal stylesheet, so that if JS is on the JS stylesheet will over-ride the normal one.
Other possible way depending on your layout - I've used document.write to write a <div> around something and then you apply the JS specific CSS to that div. Takes a bit of fiddling though!
<noscript> problem
Other possible way depending on your layout - I've used document.write to write a <div> around something and then you apply the JS specific CSS to that div. Takes a bit of fiddling though!
If you take that one step further, you could use the JS to set an id or class on the body element.
<noscript> problem
In this case, that's one heck of a lot of fiddling for the sake of just a few people. I'll probably get around to doing that when the site is fnished, but thanks for the advice - it makes sense (even if I wish that noscript/link was xhtml compliant - I really don't understand why it's not. It seems simpler that way.)
<noscript> problem
OK, class. Get out your notebooks and sharp #2 pencils.
<head> may contain <script> which may be parent to <noscript>. Now <noscript> may parent only %block elements. <link> is a %misc.head element that may be the child of <head> onlyâa single parent household, if you will. You can't put <head> in the <noscript> because, among other things, there may be only one <head> per document and <html> may parent only <head> and <body>. <noscript><link ...></noscript> has not been valid in any incarnation of html. So, you're SOL.
The work-around is to have the top level menu item be a normal,, everyday clickable link to an appropriate top level page for the group of links. You should have a reasonable amount of text describing each lower link and the links beyond that. Sort of a sectional site map.
If you're being really slick, say with clickable dropdowns ala the os 'file', 'edit', 'view', etc. buttons, then you must have graceful failover. I'd simply use the same kind of thing you'd use for a link that opened a new window,
<a href="#" onclick="return ! popupmenufunction();">Sales Group</a>If the popup works, the click is not seen by the link. If it fails, even if js is on, a true is returned and the link fires. If js is off, the link fires.
The key is to always have a route to all links. I've actually visited sites whose menus were totally unusable without js. You were stuck there without any access to the site. Stupid, huh?
And don't believe that a miniscule number of people don't have js on. The great unwashed masses may not even know it can be turned off, but corporate IT depts do. Since you can't kill active-x without killing js, those worried about IE as a gateway for malware are shutting both down. Then add in the number of folks using some assistive technology. I'd say the js-off cases are much more than the usual 10% you hear.
cheers,
gary
<noscript> problem
Since you can't kill active-x without killing js
That's a bit extreme isn't it, you can disable ActiveX in the security settings of IE you can also set killbits in the registry or use a decent software firewall with ActiveX blocking. I have 3 levels of ActiveX blocking, it can't run at all, but I still have scripting enabled.
Hugo.
<noscript> problem
Ah, I was referring to the normal security settings, but am admittedly behind times with IE sp1 on Win98se. Some of my sys/net-admin buddies have told me they prefer to disable js, too. That may be laziness or paranoia on their parts. Of course I don't associate with MS fanboy types so I don't necessarily get both sides of the story.
cheers,
gary