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



How To Detect If User Javascript Is Enabled PHP HTML Script Code Sample
 (382) Find work at Home Jobs
How To Detect If User Javascript Is Enabled PHP HTML Script Code Sample
Post Description:
Post Tags: how, to, detect, if, user, javascript, is, enabled, php, html, script, code, sample
This Post Has Been Viewed 5170 Times Since Wed Nov 22, 2006 1:34 pm Posted By braker with 2 replies
How To Detect If User Javascript Is Enabled PHP HTML Script Code Sample
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:
post picture

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     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About How To Detect If User Javascript Is Enabled PHP HTML Script Code Sample




:: 1 :: #30546 - Reply By Jules On Tue Dec 04, 2007 1:11 pm
perfect!!!!!!!!!!!!1 thank you for making this annoyance simple
:: 2 :: #31498 - Reply By gregg On Thu Dec 13, 2007 2:30 am
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...