PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Gustav Eklundh   jsCheck   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example on how to use the class.
Class: jsCheck
Check whether Javascript is enabled in the browser
Author: By
Last change: Changed the name of the class-file to match the one uploaded.
Date: 14 years ago
Size: 448 bytes
 

Contents

Class file image Download
<?php
require("class.jscheck.php");
# This example is using the form-methond through checkJsByForm()
$js = new jsCheck;
$js->checkJsByForm();

if(
$js->isJsActivated() === true) {
# After the call to checkJsByForm() is done we use the function isJsActivated to see if JS is activated or not.
# The function returns true if activated and false otherwise.
   
echo "JavaScript is activated!";
}
else {
    echo
"JavaScript is not activated!";
}