A dead simple way of testing for JavaScript:
<script>
window.location.href = 'javascriptCapable.cfm';
</script>
<meta http-equiv=refresh content="1; url=nonJavascriptCapable.cfm">
If a browser understands JS they get one page, if they don't they get
another.
One thing to consider though that it's not quite as simple as "understanding
JS"...you should be checking for specific functionality using something like
Modernizr.
http://www.modernizr.com/
andy
-----Original Message-----
From: Robert Rhodes [mailto:[email protected]]
Sent: Monday, March 26, 2012 12:00 PM
To: cf-talk
Subject: Javascript test in ColdFusion
Hello again.
I have a site that loads all the content in ajax. I also have a version of
the site that does not use ajax.
I am looking for some code I can put in the application.cfm to test to see
if the visitor's browser supports javascipt or not, so I can load the right
version of the site.
Any ideas?
Thanks.
--RR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350555
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm