svcghost — 2011-05-28T23:04:39-04:00 — #1
cranial_bore — 2011-05-29T04:03:25-04:00 — #2
You can tell PHP if JS was enabled after some interaction, such as submitting a form, but when the page is first generated PHP won't know. And even for subsequent actions there is no way to ensure the user hasn't modified your JS.
smftre — 2011-05-29T12:42:34-04:00 — #3
You should extend functionality using JS, not use it for the main functionality.
So don't rely on any security measures to be performed using JS at all, no login attempts, nothing. Rather have that hard coded that PHP will check it no matter what. You can always use JS to do checks prior to submission or whatever you like as a "nice feature", but do not use JS as the only checking point.
Can you describe your reason for needing to know if users have modified your JS? Is it some security concern? Secure token that is sent etc?