是否有可能隐藏或扰乱/混淆网页的JavaScript代码? [英] Is it possible to hide or scramble/obfuscate the javascript code of a webpage?

查看:203
本文介绍了是否有可能隐藏或扰乱/混淆网页的JavaScript代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,客户端代码必须可以从浏览器读取,但我想知道(因为有太多我忽略的东西),如果有方法将代码混淆到最终用户,并且如果不是最佳实践来打包JavaScript代码。

I understand that client side code must be readable from the browser but I wonder (since there are too many things that I ignore) if there are ways to obfuscate to code to the end user and, if not what is the best practice to "pack" the javascript code.

推荐答案

最好的做法是用诸如 YUI Compressor 。我不会混淆它,除非你有特定的需要这样做。有很多在线混淆器,例如这一个

It is good practice to minify your JS with a tool such as YUI Compressor. I would not obfuscate it unless you have a specific need to do this. There are plenty of online obfuscators such as this one

请参阅此文章: http://developer.yahoo.net /blog/archives/2007/07/high_performanc_8.html

这篇关于是否有可能隐藏或扰乱/混淆网页的JavaScript代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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