How to hide the version of jQuery

boleslaw.smialy Source

I'd like to hide the version of jQuery library used in my project so nobody can see which version is in use (at least just by quick looking at the code).

While removing a JS comment containing jQuery version is fairly easy, there is a variable hardcoded into jQuery which reveals the version:

var ah = "1.11.3"

My wish is to empty the variable, however I'm not a frontened developer so I don't know what could potential consequencies.

Does jQuery uses this variable is some particular way?



answered 8 months ago Ryan McDonough #1

So two points:

  1. Yes removing that could have issues, 3rd party plugins will use: jQuery().jquery to get the version to see if the version used is a recent enough version for the plugin to work, if you remove that the plugin could not load or try and work and have massive issues if the version of jquery isn't 'good' enough.

  2. Removing the version won't help in people not being able to identify if they really want to, it just adds a 2 minute step to the process of just comparing the rest of the code to jquery versions.

I would strongly advise not to remove the version number or change it.

comments powered by Disqus