Re: Detecting JavaScript

From: Date: Mon, 26 Feb 2001 16:55:39 +0000
Subject: Re: Detecting JavaScript
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41702@lists.php.net to get a copy of this message
Nothing tested, just off the top of my head. The single most reliable way to do that would be to have a page that runs JavaScript. For instance, if the JavaScript executes, it redirects to your JavaScript enabled page, if not, the page does a refresh to a non JavaScript enabled page. <html><head><title>tester></title> <script language='JavaScript'> window.location('http://some.javascript.enabled.page'); </script> <meta http-equiv=refresh content='5;url=http://some.nonjavascripting.page'> </head> The trick would be a matter of timing, the JavaScript must successfully execute before the timer runs out on the refresh tag. You can of course get much fancier, changing the redirect based on the client information that PHP has available. PHP could effectively write the JavaScript to the page based on the known capabilities of the client. For instance the refresh tag is generally useless for browsers like Lynx, as is the JavaScript. Alternatively, you could (just supposing now...) have the first page do an instant refresh, using JavaScript to trigger a value in PHP. If the value is set, JavaScript was enabled, if it is not, JavaScript was turned off. But I've not tried it. DAve -- Dave Goodrich Director of Interface Development Reality Based Learning Company 9521 NE Willows Road, Suite 100 Redmond, WA 98052 Toll Free 1-877-869-6603 ext. 237 Fax (425) 558-5655 daveg@rblc.com http://www.rblc.com > From: Jochen Kächelin <jk@wa-p.de> > Reply-To: <jk@wa-p.de> > Date: Sun, 25 Feb 2001 05:37:17 +0100 > To: "Php-General@Lists. Php. Net" <php-general@lists.php.net> > Subject: [PHP] Detecting JavaScript > > Who can give me a PHP-Script to > detect if JavaScript is enabled? > > It should work with both, IE and NN! > > thanks > > -- > Ihr WEBberater > Stuttgarter Str.3, D-73033 Göppingen > Tel. +49(0)7161-929594 - Fax. +49(0)7161-929598 > http://www.wa-p.de ** > mailto:jk@wa-p.de > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#41702) next »