March 10, 200917 yr Hey, Designing a new site with a few jazzy Ajax effects (scrollers and such) but ofcourse i'm trying to make this as accessible as possible. i want to discover if the users browser has javascript enabled, and if not use PHP to manipulate a few css attributes on load to compensate for the javascript. researching this on the www suggests the easiest option is to use a javascript re-direct on load to redirect to the javascript rich page if it is enabled, and if not obviously it will stay on the non JS page. this seems a bit of a long way round and on top of that apparently effects google performance. is it at all possible to either check a variable with PHP that has been set using javascript, or check an elements class using PHP? i could then use this to check against using PHP and determine if javascript is enabled, and stop the changes to the page. or is there a more standard method for doing this? Thanks, Dean
March 10, 200917 yr Hi there, it seems to me that you're looking at this from the wrong angle. Ideally, you should build the page first without using any javascript functionality at all. Only then should you start to add javascript to the page, introducing effects, manipulating the DOM, adding classes etc. This way, users without js get a working, functional site and users with js get the swish extras. Doing it this way means there is no need to check if js is enabled. Hope that helps
March 10, 200917 yr Author Thanks Elan man, that kind of helps and doesn't help at the same time :s i understand exactly where you're coming from, and of course it should always be the way sites are made. sorry i think i've worded my last post a bit wrong (it was 1:30am after all ). my site is fully accessible and usable for people who do not have javascript enabled. All the content can be reached perfectly well without the swishy effects. but because of the sections the effects are being used in, slide bars are required, which doesn't look quite as aesthetically pleasing, as if they weren't there. I know, I know, some people are going to say 'why don't you re-design the site so it looks good with them, that way you don't have to worry either way.' but it would be nice to be able to do it both ways, and still not be compromised, kind of a have my cake and eat it scenario. It's my site, why shouldn't i after all?
March 10, 200917 yr Author Hi there, it seems to me that you're looking at this from the wrong angle.Ideally, you should build the page first without using any javascript functionality at all. Only then should you start to add javascript to the page, introducing effects, manipulating the DOM, adding classes etc. This way, users without js get a working, functional site and users with js get the swish extras. Doing it this way means there is no need to check if js is enabled. Hope that helps found a simple solution to my problem added a class of 'js-disabled' to the elements using javascript in the written HTML. This displays the page as fully accessible to people who have javascript turned off. Then made a script that runs on document ready that cycles through all elements with the class of js-disabled and replace it with a class of js-enabled that has the styles for the javascript elements. people without get to see all the content nicely, and for those lucky people with javascript enabled they get the extra swishy effects.
March 10, 200917 yr Author let's see it then! www.deanpuckett.co.uk/portfolio i've even made it so that if javascript is turned off people can still click links to zoom to the content without even needing scroll, but still have the option to. just finished putting the final touches to it. any comments let me know
Create an account or sign in to comment