我正在从 stackoverflow 学习并获得很多解决方案。当我研究它时,我发现 .js 文件没有像这样的结构:
function MSIsPlayback()
{
try
{
return parent&&parent.WebPlayer
}
catch(d)
{
return!1
}
}
但是他们把这个写成一行,比如,
use strict';window.StackExchange={};function MSIsPlayback(){try{return parent&&parent.WebPlayer}catch(d){return!1}}if(!MSIsPlayback()&&top!=self)throw top.location.replace(document.location),$(function()$("head").add("body").remove()}),alert("For security reasons, framing is not allowed; click OK to remove the frames."),Error();
为什么?
是程序员写的吗?或者任何软件在编译后以这种模式转换它?如果他们错了,那么如何调试呢?
请帮忙 谢谢
最佳答案
那是缩小后的js文件。 通常,您应该在发布时缩小您的 js 文件,以减少加载时间。
您可以找到未压缩的 jquery 源代码 here
关于javascript - 如何构建源代码以使其占用更少的空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21493597/