/    Sign up×
Community /Pin to ProfileBookmark

Looking for a script that will check if browser is css capable and if not redirect to an information page.
I’m looking for something low profile (not a lot of code)
Any help would be appreciated……………….

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Mar 17.2005 — I really do not think there is any real ways of doing it. All current browers support it. There might be a way of checking a css property and if it is not there, then it would know, but I have no clue, now I am rambling.

What are you worried about?

Eric
Copy linkTweet thisAlerts:
@felgallMar 17.2005 — There is no actual way to test if CSS is supported and the level of support varies between browsers anyway. The simplest code to get as close to what you are asking for in the smallest amount of code would be to test if the browser supports the standard Document Object Model. All browsers that support this (eg. IE5+, NS6+, Firefox, Mozilla, Opera5+) all support CSS to some extent. Some browsers that don't support the standard DOM (eg IE4, NS4) have minimal CSS support but probably not sufficient to be worth worrying about.

[CODE]if (!document.getElementById) location = 'nocss.htm';[/CODE]
Copy linkTweet thisAlerts:
@thedosmannauthorMar 18.2005 — Thanks

I found this :

if (document.getElementById)

{

// you can script the box

}

else

{

// it's not going to work so...

return false;

}

Which is a longer version of yours...

So I'll stick with yours..

Now I need to to allow for no css support and javascript disabled..

I can do the <noscript> but if the browser can't support css it will error on access to the page. NS 4.5 says "can't find page" on access.

The added detect will redirect on access but if js is disabled it will never get to <noscript>.

Fun ...fun
×

Success!

Help @thedosmann spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...