WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Check if Javascript is Enabled or Disabled - Works in all Browsers
Categories : Java Script, HTML, Web Browsers Click here to Update Your Picture
Soeren Walls
Date : Oct 20th 2009
Grade : 4 of 5 (graded 2 times)
Viewed : 3492
File : 4997.html
Images : No Images for this code example.
Search : More code by Soeren Walls
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

This script works in any browser that supports javascript. No PHP or special scripting is involved.

The only scripting languages used in this script are Javascript and HTML. The script is a fairly short script, but it will do the job.

It will be easier to understand this script if you have a simple knowledge of HTML and javascript. If you don't you can still just copy and paste into your website.

This script is free to all, and it can be edited, reposted, or redistributed.
By taking/using this script, you understand that I am not responsible for any problems that may occur.

Use the example below to do this in your website. First, make a file with a file extension that supports HTML and Javascript (such as .html OR .php). Remember to include the "onLoad" portion of the body tag.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<title>Soeren Walls - How to Check if Javascript is Enabled</title>

<script type="text/javascript">
function checkForJavascript() {
   /* use this code to only display a message when javascript is disabled */
   document.getElementById('divJavascriptDisabled').style.display = "none";
   /* use this code to show different messages based on whether Javascript is enabled or not */
   document.getElementById('divJavascriptChange').innerHTML = "Javascript is enabled.";
   }
</script>

</head>

<!--
**** REMEMBER to include the "onLoad" portion of the body tag. It is vital to the code.
-->

<body onLoad="checkForJavascript();" style="font-family: Trebuchet MS, Lucida Grande, Verdana, Arial, Sans-Serif; font-size: 12px;">

<p>
Script written by Soeren Walls.<br />
You may remove this message if you would like to. This script is free to all and can be edited, reposted, or redistributed.<br />
By taking/using this script, you understand that I am not responsible for any problems that may occur.<br />
This script works in any browser that supports javascript. No PHP or special scripting is involved.<br />
__________________________________________________________________________________________________
</p>
<p>
If javascript is disabled, you will see a message below. If it's enabled, no message will appear.
</p>

<div align="left" id="divJavascriptDisabled" style="width: 300px; display: block; background-color: #005263; border: 1px dashed #000; padding: 3px; color: #FFFFFF; text-align: center;">
Javascript is disabled. Please enable javscript.
</div>

<p>
__________________________________________________________________________________________________
<br />
Or, if you would like to display different text depending on whether Javascript is enabled or disabled, then use the following script.
</p>

<div align="left" id="divJavascriptChange" style="width: 300px; display: block; background-color: #005263; border: 1px dashed #000; padding: 3px; color: #FFFFFF; text-align: center;">
Javascript is disabled. Please enable javscript.
</div>

</body>
</html>



How to keep your tables width stable even if you have long strings inside.
Categories : CSS, Web Browsers, HTML, Beginner Guides
Show or Hide your Content using Javascript
Categories : Java Script, HTML, CSS, Beginner Guides
How to create <SELECT> menues that change on the fly according to other <SELECT> menues on the page?
Categories : Java Script, HTML
Cool tool tip
Categories : Java Script, HTML, Web Design
Higly Customizable Javascript Calendar Script
Categories : Java Script, Calendar, Date Time, HTML, CSS
showing Help (assistance) to the user while filling html forms.
Categories : HTML, Java Script, Form Processing
Conditional Check - a script that allows a user to submit a form only if the user check a checkbox.
Categories : HTML, Java Script, Form Processing, Beginner Guides
Prevent Right Mouse steal your graphics
Categories : HTML, Java Script, Security
Bookmarklets are simple tools that extend the surf and search capabilities of Netscape and Explorer web browsers.
Categories : Java Script, HTML, General
Unobtrusive javascript for maintaining scrollable layer state
Categories : DHTML, Java Script, HTML
AutoComplete in HTML forms
Categories : DHTML, HTML, Web Browsers
Enchancing dd/mm/yyyy forms with unobtrusive javascript
Categories : Java Script, HTML, User Interface, Date Time
Mordern Peroidic Table - Science
Categories : Java Script, HTML, Charts and Graphs
Javascript linked dropdowns
Categories : Java Script, HTML, Classes and Objects
Javascript animated menu items
Categories : DHTML, CSS, Java Script, HTML