简体   繁体   English

有没有一种干净的方式来查看网站的 JavaScript?

[英]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.

相关问题 在 Javascript 中级联函数的干净方法是什么? - What's the clean way to cascade functions in Javascript? 使用JavaScript或JQuery生成和附加HTML的干净有效方法是什么? - What's a clean and efficient way to generate and append HTML with JavaScript or JQuery? 在JavaScript中共享异步函数响应的干净方法是什么? - What's a clean way to share async function response in Javascript? 清晰的方法来构建JavaScript对象 - Clean Way to Build a JavaScript Object javascript有没有办法以干净的方式多次清理字符串 - javascript is there a way to clean up a string multiple times in a clean way 通过 JavaScript 检查网站是否启动的最佳方法是什么 - What's the best way to check if a website is up or not via JavaScript 通过JavaScript进行网站图像管理 - 处理这个问题的好方法是什么? - Website image management via JavaScript - what's a good way to handle this? 在 JavaScript 中获取给定 class 的所有 ID 的简洁明了的方法是什么? - What is a clean and concise way to get all id's of a given class, in JavaScript? 让服务器返回一个JavaScript函数然后被调用的干净方法是什么? - What's a clean way to have the server return a JavaScript function which would then be invoked? Javascript:是否有一种干净的方法可以根据变量的值是否存在来访问 object 属性? - Javascript: Is there a clean way to access object properties depending on whether a variable's value exists?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM