Jump to content

is JS enabled??


ag3nt42

Recommended Posts

Include a no script tag that has a hidden 1x1 img that is actually a PHP script.

 

In the head section of your template, but only add this part if $_SESSION['JavaScript'] is not yet set.

<noscript>
  <img style="display: none;" src="/noscript.php" alt="Detecting JavaScript" />
</noscript>

 

noscript.php

<?php
  session_start();
  $_SESSION['JavaScript'] = false;
  fpassthru( '/path/to/1x1.gif' );
?>

Link to comment
Share on other sites

<noscript> is an HTML tag where the content is only rendered in a browser when JavaScript is turned off.  The <noscript> tag I gave you has a single item in it, an invisible image.  It just so happens that the src-attribute of the image points at a PHP script you create on the server.  Hence this script is called by the client ONLY if JavaScript is disabled.

 

In the noscript.php on your server, you set a session variable indicating that JavaScript is off.  Then you fpassthru the contents of a 1x1 gif image (because it's supposed to be an image).

Link to comment
Share on other sites

Ermm...i think u can check this by select Tools and inside the content u can c whether ur JS is enabled or not.

 

Hope this can help :)

The OP wasn't asking how to check if JS was enabled or not in his browser but in the client's browser.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.