是否可以为下面的代码解压缩(如果这是正确的术语)?
var vote=function(){var k={informModerator:-1,undoMod:0,acceptedByOwner:1,upMod:2,downMod:3,offensive:4,favorite:5,close:6,reopen:7,deletion:10,undeletion:11,spam:12};var f=imagePath+"vote-arrow-down.png";var c=imagePath+"vote-arrow-down-on.png";var x=imagePath+"vote-arrow-up.png";var w=imagePath+"vote-arrow-up-on.png";var A=imagePath+"vote-favorite-on.png";var o=imagePath+"vote-favorite-off.png";var l=function(){var C='<a href="/users/login?returnurl='+escape(document.location)+'">login or register</a>';$("div.vote").find("img").not(".vote-accepted").unbind("click").click(function(D){u($(D.target),"Please "+C+" to use voting.")});z().unbind("click").click(function(D){u($(D.target),"Please "+C+" to flag this post.")})};var B=function(C){if(!C){C="div.vote"}$(C).find("img.vote-
我为此问题搜索了stackoverflow,但没有找到结果
答案 0 :(得分:18)
是。复制/粘贴到此处:http://jsbeautifier.org/
只会重新格式化布局。您无法恢复变量/函数名称。
与MetaSO相关:Can we get an un-obfuscated version of the vote object?
答案 1 :(得分:0)
我认为像Eclipse这样的东西可以为你自动格式化它。但是无法取回任何原始变量名称。
答案 2 :(得分:0)
如果你要做的是看到用于描述代码的原始变量,那么没有。您总是可以花时间通过格式化程序来运行它,以便更容易直观地阅读,但变量和函数名称将永远丢失。
答案 3 :(得分:0)
在您的具体示例中,您应该可以解压缩它。
但请注意,大多数压缩器都会重命名变量。那时,代码是IMO,不再是人类可读的。
var vote = function() {
var k = {
informModerator: -1,
undoMod: 0,
acceptedByOwner: 1,
upMod: 2,
downMod: 3,
offensive: 4,
favorite: 5,
close: 6,
reopen: 7,
deletion: 10,
undeletion: 11,
spam: 12
};
var f = imagePath + "vote-arrow-down.png";
var c = imagePath + "vote-arrow-down-on.png";
var x = imagePath + "vote-arrow-up.png";
var w = imagePath + "vote-arrow-up-on.png";
var A = imagePath + "vote-favorite-on.png";
var o = imagePath + "vote-favorite-off.png";
var l = function() {
var C = '<a href="/users/login?returnurl=' + escape(document.location) + '">login or register</a>';
$("div.vote").find("img").not(".vote-accepted").unbind("click").click(function(D) {
u($(D.target), "Please " + C + " to use voting.")
});
z().unbind("click").click(function(D) {
u($(D.target), "Please " + C + " to flag this post.")
})
};
var B = function(C) {
if (!C) {
C = "div.vote"
}
$(C).find("img.vote-")
};
答案 4 :(得分:0)