how to check if javascript is enabled in a module drupal7
I don't think there is a way. Because your module runs on the server and it cannot interact with the client's browser in any way. 

Here's an answer on stackoverflow: Check if JavaScript is enabled with PHP