/    Sign up×
Community /Pin to ProfileBookmark

Detecting Javascript & process include accordingly

I’m trying to find the best way to detect whether javascript is enabled and leave out a stylesheet include if it is turned off. This code is on a header include .cfm file, so it needs to be run on every page in the site.

Any thoughts? Thanks in advance!

(Bonus huge thanks if you can tell me how to pass the on/off as a variable to my ColdFusion code ? )

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterApr 15.2005 — You could force the users to goto a testing page first before bring them to where you want them to go... What I mean is that you can force the user goto the page JSDetector.html and use that script to send a query string to your next page.

On the tester page you can use an HTML tag to redirect the vistor to the page

index.html?JSENABLED=false

and also have a JavaScript that should be able to beat the HTML redirection and redirect the vistor to

index.html?JSENABLED=true
Copy linkTweet thisAlerts:
@UltimaterApr 15.2005 — Well... There would be no point in sending a Query String to an HTML file with JS disabled, now would there? LOL, I don't know what I was thinking...

You should send the query string to a server-side program instead... LOL

Also, it would be possible to out-smart this process by switching off JS after the re-direction... But this is one possible alternitive.
×

Success!

Help @NanGmail 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.20,
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,
)...