Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么要有同源限制? #57

Open
Sogrey opened this issue Apr 26, 2019 · 0 comments
Open

为什么要有同源限制? #57

Sogrey opened this issue Apr 26, 2019 · 0 comments

Comments

@Sogrey
Copy link
Owner

Sogrey commented Apr 26, 2019

我们举例说明:比如一个黑客程序,他利用Javascript读取到你的表单中 什么是 "use strict"; ? 使用它的好处和坏处分别是什么?

Javascript在更严格的条件下运行。

设立"严格模式"的目的,主要有以下几个:

- 消除Javascript语法的一些不合理、不严谨之处,减少一些怪异行为;
- 消除代码运行的一些不安全之处,保证代码运行的安全;
- 提高编译器效率,增加运行速度;
- 为未来新版本的Javascript做好铺垫。

注:经过测试 缺点:现在网站的merge 后,这个串就到了文件的中间,不仅没有指示严格模式,反而在压缩后浪费了字节。

#56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Web面经题
网络及安全
Development

No branches or pull requests

1 participant