如何隐藏jQuery的版本 [英] How to hide the version of jQuery

查看:2274
本文介绍了如何隐藏jQuery的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想隐藏我的项目中使用的 jQuery 库的版本,这样就没有人能看到哪个版本是在使用中(至少只是通过快速查看代码)。

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).

虽然删除包含jQuery版本的JS注释相当容易,但是有一个变量硬编码到jQuery中版本:

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.

jQuery是否以某种特定的方式使用此变量?

Does jQuery uses this variable is some particular way?

推荐答案

所以两点:


  1. 是删除可能有问题,第三方插件将使用:jQuery()。jquery获取版本以查看所使用的版本是否为最近足够的版本的插件工作,如果你删除该插件无法加载或尝试工作和哈如果jquery的版本不够好,那么就会出现大问题。

  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.

删除版本无法帮助那些无法识别它们的人真的很想,它只是在将剩下的代码与jquery版本进行比较的过程中增加了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.

这篇关于如何隐藏jQuery的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆