0

On web page, I want to check whether the user has no script available.

Just after the check, I want to write something on php code (like put some log in db).

I have checked on some sites, such as: PHP & <noscript> combination to detect enabled JavaScript in browser

and Check whether Javascript is enabled but the problem is, that the server side will have $_COOKIE or $_SESSION set as wanted (for the check) only after the page is reloaded again.

I want to check on php, that the client doesn't support javascript, just on first clicking the page (no need clicking it twice).

How can I do that?

Thanks :)

Community
  • 1
  • 1
Eitan
  • 1,286
  • 2
  • 16
  • 55

1 Answers1

3

In the noscript section you could load a resource from your server. If the a visitor loads the resource, you know that he has JavaScript disabled.

smiggle
  • 1,259
  • 6
  • 16
  • OK, thank you. I see that the php run after the whole html had been loaded (not while loading), but since I know that fact, I can check later the consequences (such as writing to db) only after the loading of the page - that's OK with me. Thanks anyway – Eitan Aug 22 '14 at 12:02