At 9:02 AM +0100 4/28/11, Geoff Lane wrote:
but not AFAICT at 'first contact' because you need the 'first contact'
page to do something to prove that JS is available, from which you can
assume that JS is not should that something not be done. For example,
you can make the link to a page into a form submission - e.g:
<form name='jstest' action='myscript.php' method='post'>
<input type='hidden' name='wehavejs' value=1>
The form is submitted if the browser has JS and so the hidden input
field is posted. However, if the browser doesn't have JS the default
behaviour occurs when the link is clicked and so the field is not
posted. Hence we can use isset($_POST['wehavejs']) to determine
whether or not the browser has JS capability.
You are correct about "first contact" -- you need to launch the
There's currently no way for the server to see what the user has
selected for their browser before the browser launches.
It is true that the $_SERVER global provides all sorts of information
about the requester and I suppose it could also contain the browser's
you have proposed via a form.
Instead, you can simply add an "onload()" operation to the page and
Or do it unobtrusively as I have shown before.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php