Re: [SMARTY] Setting a variable if javascript is enabled?
| From: | Jason Sweat | Date: | Wed, 12 Feb 2003 13:37:02 +0000 |
| Subject: | Re: [SMARTY] Setting a variable if javascript is enabled? | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7677@lists.php.net to get a copy of this message | ||
Hi Matthias,
Sorry for mis-reading your question.
As far as I know, there is no $_SERVER variable that tells _if_ js is
enabled ( you could check the $_SERVER['HTTP_USER_AGENT'] to see if they are
running a browser capable of js).
You could try something sneaky like having js do a document.write of a 1
pixel x 1 pixel image that is a php script. This script could set a
variable in the session indicating that js is enabled (and then output the
small image), and the rest of you app could work from that.
HTH
Jason
----- Original Message -----
From: "Matthias Mohr" <MMohr@sysdesign-edv.de>
To: <smarty-general@lists.php.net>
Sent: Wednesday, February 12, 2003 7:15 AM
Subject: Re: [SMARTY] Setting a variable if javascript is enabled?
> Hi Jason,
>
> > http://smarty.php.net/faq.php#18
> That was not the question.
>
> I need to set a smarty or PHP-variable if javacript is enabled
> for using javascript-codesnippets inside my HTML-elements.
> (like the usage of the javascript &{mydisp} variable inside the
> UL-tag)
>
> I've already escaped my javascript code by changing the default-
> delimiters of smarty to "<{" and "}>", so escaping javascript is
> not the problem...
>
> Anybody else any idea?
> Maybe there is a REQUEST-variable I could use, or other
> PHP-features...
> But I didn't find any useful.
>
> with regards,
> Matthias
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>