Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8222919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:26:32+00:00 2026-06-07T14:26:32+00:00

Ok so, I’ve been doing some research on detecting if a user has css

  • 0

Ok so, I’ve been doing some research on detecting if a user has css disabled. I know that not even 2% of the world browses the web with css disabled, but I still have a need to detect whether or not the css is loaded.

Basically I use a combination of classic asp and jquery to detect if a user is logged in, then with the jquery will fadein an overlay on the window with a login form. If the user goes to that specific page and disables the css all my content is still readily available to them.

I’m wondering if there is a better way to do this with jQuery? Something that will detect if the style sheets have been disabled/removed on the fly.

I already use <noscript> to redirect the user if javascript is disabled, but I’d like to take the extra precaution and either redirect them.

I tried using just a simple javascript display check to see if a specific div element were hidden or not, to ‘detect’ if the css was disabled. But in Chrome if I’m on the page and I use web developer to disable all css the javascript alert doesnt show. The alert is just ment as a test to check for it, I’ll add the redirect once I figure out how to do it correctly.

Any help or suggestions are greatly appreciated, Thanks in advance.

<noscript>
<meta http-equiv='refresh' content='0;url=old_login.asp'/>
</noscript>


<script type="text/javascript">
    var csschk = document.getElementById('nocss');

    if (csschk.style.display = 'none') {
    } else {
        alert('Please enable CSS to view this page');
    }

</script>

<style>
#nocss {
display: none;
}
</style>

<div id="nocss">no css</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:26:34+00:00Added an answer on June 7, 2026 at 2:26 pm

    I think you have more serious issues here. Regardless of CSS being enabled or not, a simple view source would show your page and it’s content.

    You need to re-think your approach. Either do a normal form post with credentials before you show secure content or use AJAX if you want to avoid a page refresh.

    See here for examples of submitting a form using Ajax:
    http://randomactsofcoding.blogspot.com.au/2008/10/jquery-ajax-and-classic-asp.html
    http://heybigname.com/2009/04/15/ajax-with-jquery-a-simple-login-example/
    http://blog.webwizo.com/2011/05/04/simple-login-with-php-and-jquery-ajax/

    For academic purposes, to check if the page has CSS you could use jQuery / JavaScript to detect the existence of a link tag inside the head tag.

    You could also use A library like Modernizr to do feature detection and check if CSS features work in a browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I need a function that will clean a strings' special characters. I do NOT
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.