Limitations of JS in the browser

Source: Internet
Author: User

As we all know, because of security considerations, the JavaScript script running in the browser will be a lot of restrictions, here do a little generalization:

1.JS does not allow access to the host computer:

JS was originally unable to read or write to the user's computer's file system (except for cookies), but HTML5 new file API allows us to break this limit (but there are still other restrictions, interested students can refer to HTTP// www.html5rocks.com/zh/tutorials/file/filesystem/).

2. Same-origin strategy:

Everyone should know that the two-page domain must be the same to allow communication between the two.

3.js cannot read the properties of a historical object, even if you can let the user back in the browsing history, but cannot know which page they are returning to.

4.js can not set the value of the File Upload form field, that is, if you want to <input type= "file" name= "file" > the domain Setting value value, the browser will error.

5. If JS tries to close a window opened by the user, the user is asked to allow the operation, but the window opened by JS does not have this limitation.

6. The browser does not allow you to open a window that is less than 100*100, or a window that is located outside the viewable range.

Limitations of JS in the browser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.