[英]Is there a clean way to look at a website's JavaScript?
I'm just starting out and there are times where I see a website's function/interaction and I'd really like to read/learn the code they used to better understand how something was done.我刚刚开始,有时我会看到网站的功能/交互,我真的很想阅读/学习他们用来更好地了解某些事情是如何完成的代码。 I know there's view pagesource but it's a mess and Inspect Element is really on the HTML/CSS.
我知道有 view pagesource 但它很乱,Inspect Element 实际上是在 HTML/CSS 上。
JS is often minified making it a mess but you can use browser developer tools to prettify it. JS 经常被缩小使其变得一团糟,但您可以使用浏览器开发人员工具来美化它。 How you can do it depends on your browser.
如何做到这一点取决于您的浏览器。 In Firefox it is an icon in Debugger under the code view.
在 Firefox 中,它是代码视图下调试器中的一个图标。 There is no way to fix minified names like Carcigenicate commented but if it's open source library like jQuery you can find the source from their git repo.
没有办法修复像 Carcigenicate 评论这样的缩小名称,但如果它是像 jQuery 这样的开源库,你可以从他们的 git repo 中找到源代码。
这个网站有一个工具,你可以用它把丑陋的缩小的 JS 代码变成一个漂亮的源代码来阅读: https : //html-cleaner.com/js/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.