Jeremy Chapman wrote:
Is there any way via server side code to determine if the browser supports
javascript?
It's often considered more elegant to determine JavaScript capabilities
on the client and to degrade gracefully if it doesn't.
For example:
<a href="nojs.html" onclick="doSomething();return false">Go</a>
This way, the function is executed if JS is enabled. return false
prevents the HREF to be displayed. If JS is off, the HREF is executed
and nojs.html is displayed, which is a page explaining why the user
experience would be so much better with JS.
Also, if JS is on, you can use object detection to see if only certain
functions are enabled:
if ( document.getElementById )
{
document.getElementById( "..." ).value = "...";
}
else
{
if ( document.all )
{
document.all[ "..." ].value = "...";
}
else
{
alert( "You're doomed" );
}
}
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering:
http://www.galasoft-LB.ch
Private/Malaysia:
http://mypage.bluewin.ch/lbugnion
Support children in Calcutta:
http://www.calcutta-espoir.ch