Start by assuming javascript is disabled or unavailable, then send some HTML to the client that includes this
<script>
window.location = "http://www.mysite.com/javascript.php?enabled=true";
</script>
<noscript>
possible tell the user the consequences of not having javascript enabled
</noscript>
In the javascript.php script, you can save in the session that the client supports javascript. You can also use the XMLHTTPRequest object, rather than direct redirection.
, , Javascript, , , script . , , , .