Right but I would rather just set a cookie via JS and check it on the
PHP side. Same effect.

But now a days, you shouldn't have to worry about the user not having
JS enabled.

On Jan 19, 12:57 am, AD7six <andydawso...@gmail.com> wrote:
> On Jan 18, 10:04 pm, Miles J <mileswjohn...@gmail.com> wrote:
>
> > You can't detect if JS is enabled via PHP.
>
> You can, however, do something ball-achingly simple like this:
>
> <script>
>  (function() {
>   var img = document.createElement("img");
>   img.setAttribute("src", "/I/haz/js.gif");
>   document.body.appendChild(img);
>  }());
> </script>
> <noscript>
>  <img src="/i/haz/not/js.gif">
> <noscript>
>
> Route each of those 2 permutations to a controller which e.g. logs the
> result to the session and then returns a 1px gif image; and if you
> really need to know - you know.
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to