简体   繁体   中英

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.

JS is often minified making it a mess but you can use browser developer tools to prettify it. How you can do it depends on your browser. In Firefox it is an icon in Debugger under the code view. 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.

这个网站有一个工具,你可以用它把丑陋的缩小的 JS 代码变成一个漂亮的源代码来阅读: https : //html-cleaner.com/js/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM