The delete function in JavaScript

Source: Internet
Author: User

The delete function in JavaScript is to delete the specified file or folder.

Object. Delete (force);

Where object is a required option. Should be the name of the File or Folder object.

Force is an optional option. A Boolean value that is True if you want to delete a file or folder that has a read-only property set, otherwise False (default).

And if the specified file or folder does not exist, an error occurs. Http://www.mlybyby.com

The delete function in JavaScript produces the same result as a single File or Folder, and the result of an operation that uses Filesystemobject.deletefile or Filesystemobject.deletefolder.

The Delete method does not differentiate between folders that contain content and that do not contain content. Deleting the specified folder does not consider whether the content is included.

The following example illustrates the use of the Delete method.

var fso, F;

FSO = new ActiveXObject ("Scripting.FileSystemObject");

f = fso. CreateTextFile ("C:\\testfile.txt", true);

F.writeline ("This is a test.");

F.close ();

f = fso. GetFile ("C:\\testfile.txt");

F.delete ();

The delete function in JavaScript

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.