Skip to main content
added 108 characters in body
Source Link
Ruan Mendes
  • 92.7k
  • 31
  • 163
  • 225

You can't tell if a browser has JS enabled, but you can tell if the browser supports JS http://php.net/manual/en/function.get-browser.php

$js_enabled$js_capable = get_browser(null, true)=>javascript == 1

Having said this, youthat's probably not of much use. You should reconsider whether detecting jsJS from php is a good thingPHP. There should be no need for it if you use progressive enhancement, meaning that JS only adds functionality to what's already on the page.

http://php.net/manual/en/function.get-browser.php

$js_enabled = get_browser(null, true)=>javascript == 1

Having said this, you should reconsider whether detecting js from php is a good thing. There should be no need for it if you use progressive enhancement, meaning that JS only adds functionality to what's already on the page.

You can't tell if a browser has JS enabled, but you can tell if the browser supports JS http://php.net/manual/en/function.get-browser.php

$js_capable = get_browser(null, true)=>javascript == 1

Having said this, that's probably not of much use. You should reconsider detecting JS from PHP. There should be no need for it if you use progressive enhancement, meaning that JS only adds functionality to what's already on the page.

Source Link
Ruan Mendes
  • 92.7k
  • 31
  • 163
  • 225

http://php.net/manual/en/function.get-browser.php

$js_enabled = get_browser(null, true)=>javascript == 1

Having said this, you should reconsider whether detecting js from php is a good thing. There should be no need for it if you use progressive enhancement, meaning that JS only adds functionality to what's already on the page.