This API is available on Firefox OS for privileged or certified applications 仅。

摘要

delete method is used to remove a file from a given storage area.

句法

var instanceOfDOMRequest = instanceOfDeviceStorage.delete(fileName);
					

参数

fileName

A string representing the full name (path + file name) of the file to remove.

返回

It returns a DOMRequest object to handle the success or error of the operation.

范例

var sdcard = navigator.getDeviceStorage("sdcard");
var request = sdcard.delete("myFile.txt");
request.onsuccess = function () {
  console.log('File successfully removed.');
}
request.onerror = function () {
  console.warn('Unable to remove the file: ' + this.error);
}
					

规范

Not part of any specification.

另请参阅

元数据

  • 最后修改: