Results 1 to 5 of 5

Thread: JavaScript Disabled.

  1. #1
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JavaScript Disabled.

    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.

    Thanks

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    <noscript>Your code here</noscript>
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your help....

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •