this is a function that is BUILT-IN to HTML for the last few versions.
<script>
//some script here
</script>
<noscript>
<meta http-equiv=refresh content='5;url=http://some.nonjavascripting.page'>
</noscript>
--
this will redirect non-javascript browsers to a non-javascript page.
DanO
-----Original Message-----
From: Dave Goodrich [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 8:56 AM
To: [EMAIL PROTECTED]
Cc: php
Subject: Re: [PHP] Detecting JavaScript
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
[EMAIL PROTECTED]
http://www.rblc.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]