What JavaScript Can’t Do

JavaScript is a client-side language; that is, it is designed to do its work on your machine, not on the server. Because of this, JavaScript has some limitations built-in, mostly for security reasons:

  • JavaScript does not allow the reading or writing of files on client machines. That’s a good thing, because you certainly don’t want a Web page to be able to read files off of your hard disk, or be able to write viruses onto your disk, or be able to manipulate the files on your computer. The only exception is that JavaScript can write to the browser’s cookie file, and even then there are limitations (for more information about cookies, see Chapter 10).

  • JavaScript does not allow the writing of files on server machines. There ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.