faqts : Computers : Programming : Languages : PHP : Not Quite PHP : Javascript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

31 of 48 people (65%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How can I check if the user has Javascript enabled in their browser?

Aug 9th, 2000 22:37
Gordon Laine, Marcel Hicking,


You can use simple redirection to test for JavaScript:


JStest.htm:


<!-- use script to redirect to a page that uses script -->
<script>//etc.
  document.location="JS_page"
</script>

<!-- if JS redirect not work, HTML redirects to non-script page -->
<head>
  <meta http-equiv="Refresh" content="1; URL=non-JS_page">
</head>