What JavaScript cannot do

Source: Internet
Author: User
In many ways, JavaScript can be used to improve your webpage and improve the efficiency of your website access, but there are several things JavaScript cannot do. Some of these restrictions are caused by the script browser window running, so the server cannot be accessed, while others are for security reasons to prevent web pages from tampering with your computer.

In many ways, JavaScript can be used to improve your webpage and improve the efficiency of your website access, but there are several things JavaScript cannot do. Some of these restrictions are caused by the script browser window running, so the server cannot be accessed, while others are for security reasons to prevent web pages from tampering with your computer. There is no way to solve these limitations, and anyone who complains that their computer cannot execute the following tasks through JavaScript is not fully considered.

Without the help of server scripts, JavaScript cannot write files on the server.

With Ajax, JavaScript can send requests to the server. This request can be used to read files in XML or plain text format, but it cannot write files, unless the files called by the server are run as scripts to write files.

Javascript cannot access the database

Unless you use Ajax and the server script executes database access for you

Javascript cannot read or write files from users.

Although JavaScript runs on the client computer and the client is browsing the webpage, access to data other than the webpage is not allowed. This is for the sake of security, because other webpages may update your computer and we do not know how to install it illegally. The only exception is the so-called cookie file, which is a small text file that can be written and read by JavaScript. This browser limitsCookieTherefore, a given webpage can only access the cookies created by the webpage.

If no window is opened, you cannot select a window for JavaScript.

This restriction also applies to security considerations.

Javascript cannot access webpage

Although different web pages can be opened at the same time, they can be opened in a separate browser or in different forms of the same browser. Javascript running on a webpage belongs to one webpage, so it cannot be accessed from differentDomainThe information of different webpages. This restriction helps ensure that your privacy information is not shared by other people who open the web page at the same time. The only way to access files from another domain name is to call your server via Ajax, but with a server script that can access other domain names.

Javascript cannot protect your page resources and Images

All images on the page are downloaded separately to the computer. Therefore, when we look at the webpage, We have backed up all the images. The same applies to real HTML resources on webpages. The webpage needs to decrypt all encrypted webpages to display them. However, an encrypted one may require that JavaScript be activated in sequence for decryption and display. Once a webpage is decrypted, anyone who knows this method can easily save the decrypted webpage Resource Backup.

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.