Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi, i want check javascript is availabel or not in web page once it loaded. need to do without using session or cookie. javascript may be used internal or external

What I have tried:

<html>
<head>
<?php
  if(!isset($_REQUEST['JS'])){?>
    <noscript>
      <meta http-equiv="refresh" content="0; url='<?php echo basename($_SERVER['PHP_SELF']);?>?JS='"/>
    </noscript><?php
  }
?>
</head>
<body>    
<?php
  if(isset($_REQUEST['JS'])) echo 'JavaScript is Disabled';
  else echo 'JavaScript is Enabled';
?>
</body>
</html>
Posted
Updated 2-Mar-17 23:09pm
v2

1 solution

// The basic check
if(document.readyState === 'complete') {
    // good to go!
}

// Polling for the sake of my intern tests
var interval = setInterval(function() {
    if(document.readyState === 'complete') {
        clearInterval(interval);
        done();
    }    
}, 100);


Reference : Detect if a Page Has Loaded with JavaScript[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900