Javascript 查看器、美化器、格式化程序、编辑器
在上面的字段中输入您凌乱、缩小或混淆的 Javascript (JS) 以将其清理并变得漂亮。上面的编辑器还包含有用的行号和语法突出显示。有许多选项可以根据您的个人格式喜好定制美化器。
When do you use Javascript Viewer, Beautifier and Formatter, Editor
Often when writing Javascript (JS) your indentation, spacing, and other formatting can become a bit disorganized. It is also common for multiple developers to work on a single project who have different formatting techniques. This tool is helpful for making the formatting of a file consistent. It is also common for Javascript (JS) to be minified or obfuscated. You can use this tool to make that code look pretty and readable so it is easier to edit.
Javascript Beautifier Example
Minified Javascript:
var a=document.createElement('a');mimeType=mimeType||'application/octet-stream';if(navigator.msSaveBlob){navigator.msSaveBlob(new Blob([content],{type:mimeType}),fileName);}else if(URL&&'download'in a){a.href=URL.createObjectURL(new Blob([content],{type:mimeType}));a.setAttribute('download',fileName);document.body.appendChild(a);a.click();document.body.removeChild(a);}else{location.href='data:application/octet-stream,'+encodeURIComponent(content);}
Becomes this beautified :
var a = document.createElement('a');
mimeType = mimeType || 'application/octet-stream';
if (navigator.msSaveBlob) {
navigator.msSaveBlob(new Blob([content], {
type: mimeType
}), fileName);
} else if (URL && 'download' in a) {
a.href = URL.createObjectURL(new Blob([content], {
type: mimeType
}));
a.setAttribute('download', fileName);
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
} else {
location.href = 'data:application/octet-stream,' + encodeURIComponent(content);
}