Detect if JavaScript is loaded

AJAX file:

<?php
$_SESSION['js']['detected'] = '1';
echo 'OK'; // not needed