How To Detect If User Javascript Is Enabled PHP HTML Script Code Sample

RegisterLogin
How To Detect If User Javascript Is Enabled PHP HTML Script Code Sample
Post Description: How To Detect If User Javascript Is Enabled PHP HTML Script Code Sample
Tags: how, to, detect, if, user, javascript, is, enabled, php, html, script, code, sample
This Post Was Posted On Sep 25, 2009 By braker #1396
As a web designer you must must know how to make browsing easier for your clients or visitors. Some visitors disable their javascripting in their browser, so when you design a site, you must take this into consideration.

Fortunately, there is a way for webmaster, admin and designers to check if the user's browser has their javascript enabled.

In this little step-by-step tutorial guide, i will show you how to find if the user has their javascritp scripting enabled. In my examle I have a form and in order for the form to work correctly, the user has to have theri javascript enabled, otherwise, the form will not work correclty, so here it is..

1. the first step is to open your favorite text editor. I recommend you use notepad if you are using windows:

2. Once you have notepad opened, copy and paste the following code into the notepad:

     Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>How To Detect If User Javascript Is Enabled by Wallpaperama.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
</head>
<body>
<p>The Purpose of this script is to show if you have javascript enabled in your browser.</p>
<p class="style1">
<script type="text/javascript">
document.write('Javascript is enabled');
</script>
<noscript>
Javascript is disabled
</noscript>
</p>
<a href="http://www.wallpaperama.com/forums/how-to-detect-if-user-javascript-is-enabled-php-html-script-code-sample-t493.html">&lt;&lt; Go Back</a><p align="center">Script By <a href="http://www.wallpaperama.com">Wallpaperama.com</a></p>
</body>
</html>


3. Now save this notepad document as: "wallpaperama-javascript.html" Make sure you put the quotes when saving the file, some versions of windows will save it as wallpaperama-javascript.htm.txt if you don't put the quotes in between the file name.

4. Now that you have the file saved, you can open it with your favorite browser:
25p-1396-javascript-file.gif

5. DONE - Depending on your browser, if you have javascript enabled or not, it will display a message telling you whether or not you have javascript enabled in your browser.

if you want to know how to enabled or disabled javascript in your browser, visit these posts.

CLICK HERE for Firefox

CLICK HERE for Internet Explorer
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
gregg
#1816 1
great, with javascript its possible to build sites that fit into any screen, and now at least i can build an alternative for those oldschoolers out there...
Dec 13, 2007 Reply Report abuse
Jules
#1815 2
perfect!!!!!!!!!!!!1 thank you for making this annoyance simple
Dec 04, 2007 Reply Report abuse
©2011 Webune Forums - Sun Dec 18, 2011 8:31 pm
Powered by: Webune Forums V3