Re: How define if javascript is on with php

From: Date: Fri, 16 Apr 2010 12:04:48 +0000
Subject: Re: How define if javascript is on with php
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-304132@lists.php.net to get a copy of this message
On 16 April 2010 13:54, Ashley Sheridan <ash@ashleysheridan.co.uk> wrote: > On Fri, 2010-04-16 at 12:50 +0100, Paulo-WORK wrote: > >> Hello and thanks for any replies that this message may get. >> I have a issue to solve regarding PHP. >> My website relies heavlly  on jquery and does not dowgrade properly.. >> I use codeigniter framework as this website has a backend . >> Is it possible to detect if js is on with php? >> And if so can it be set into a variable? >> Paulo Carvalho >> > > > Nope, Javascript is on the client side and PHP is on the server. The > server has very little knowledge of the client, and what information is > sent (browser type, etc) can't be relied upon because browsers are > capable of lying about what they are (in order to make themselves appear > as IE for example) > > JQuery should allow the site to fail gracefully into a non-Javascript > version, because of the way the framework is built. > > If this is something that you cannot easily do, why don't you just have > PHP output some sort of default message that the site does not work > without Javascript and use CSS to hide the rest of the site that > requires script. Then, in JQuery, it's simple to hide the message and > show the site with a couple of lines of code. Or use the <noscript> tag -- <hype> WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 </hype>

« previous php.general (#304132) next »