docs: improve content accuracy (#427)

This commit is contained in:
MonsterPi 2024-03-31 18:05:45 +08:00 committed by GitHub
parent dd440a8de9
commit e00f29cbd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
---
title: 为什么一般来说,让一个网站的全局范围保持原样,永远不可触及是个好主意?
title: 为什么通常最好保留网站的全局作用域不做任何修改?
---
在浏览器中执行的 JavaScript 可以访问全局范围,如果每个人都使用全局命名空间来定义他们的变量,很可能会发生碰撞。 使用模块模式(IIFEs) 在本地命名空间中封装你的变量。