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