View Full Version : JavaScript Disabled.

10-19-2006, 07:28 AM
I have created a very simple script which based on the screen resolution will link to a specific CSS file. Now my question is, since the <link> tag for the CSS file is inside the javascript if javascript will be disabled on a visitors pc, the site will look a mess since it won't be able to link to a CSS file.

Therefore is it possible that via another language/tool to detect if a visitor has javascript disabled and if yes, i would simply send a generic CSS file.


10-19-2006, 07:31 AM
<noscript>Your code here</noscript>

10-19-2006, 07:32 AM
In this case you could also set the CSS style.
Then, in the javascript, change it at the beginning.
That way, if JS was enabled you'd have the new CSS, and if not, you'd still get the default.

10-19-2006, 07:36 AM
Thanks for your help....

10-19-2006, 07:38 AM
Also, if you set it to the right CSS at the beginning with the html, it would be best to avoid switching it with JS right away. Then just switch when needed.
the phrasing above seems to imply you must switch with JS right away, but that might cause a flicker in the page.