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

摘要

onchange property is used to specify an event handler to receive change events. Those events are triggered each time a file is created, modified, or deleted on the storage area.

句法

instanceOfDeviceStorage.onchange = funcRef
					

Where funcRef is a function to be called when the change event occurs. These events are of type DeviceStorageChangeEvent .

范例

var sdcard = navigator.getDeviceStorage('sdcard');
sdcard.onchange = function (change) {
  var reason = change.reason;
  var path   = change.path;
  console.log('The file "' + path + '" has been ' + reason);
}
					

规范

Not part of any specification.

另请参阅

元数据

  • 最后修改: