Re: Javascript detection , working version

From: Date: Wed, 10 Jan 2007 15:17:26 +0000
Subject: Re: Javascript detection , working version
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-246841@lists.php.net to get a copy of this message
At 4:54 AM -0800 1/10/07, Jürgen Wind wrote:
----8<---- [source of index] <noscript> <meta http-equiv='refresh' content='0;url=jstest110.php?js=no'> <?php /*** or put here your complete page for browsers with js disabled ***/ ?> </noscript> ----
Nice -- now instead of two different pages (i.e., index.php, jstest110.php) , make it one. Here's my solution: <http://www.sperling.com/js_detect3/> <?php if (!isset($_GET['js'])) { echo("<script type='text/javascript'>location.href='index.php?js=ok';</script>"); } else { $js = $_GET['js']; if($js != "ok") { $js = "no"; } } ?> Now, depending upon the value of $js, do whatever. It would be cool if I could send js value via a POST instead of GET-- can that be done? tedd PS: I read somewhere that using <noscript> is not recommended. -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#246841) next »