--- title: DOMCursor slug: Web/API/DOMCursor tags: - API - DOM - DOM Reference - Gecko DOM Reference - Non-standard - Reference - WebAPI translation_of: Archive/B2G_OS/API/DOMCursor ---
{{Apiref}} {{non-standard_header}}

概要

DOMCursor オブジェクトは結果のリスト全体の継続的な操作を可能にしています。これは、結果のリストを非同期で反復することを許可した{{domxref("DOMRequest")}} を拡張したものです。{{domxref("DOMCursor.continue()","continue()")}}メソッドが呼ばれるたびに、DOMCurosr はリストの次の要素へ移動を試み、結果の成功または失敗を呼び出します。

属性

{{domxref("DOMCursor.done")}}
最後の要素に達しているかを示します。

Inherited from {{domxref("DOMRequest")}}:

{{page("/en-US/docs/Web/API/DOMRequest","Properties")}}

メソッド

{{domxref("DOMCursor.continue()")}}
次のカーソルへと移動します。

var sdcard = navigator.getDeviceStorage('sdcard');
var cursor = sdcard.enumerate();

cursor.onsuccess = function () {
  console.log("File found: " + this.result.name);

  // Once we found a file we check if there is other results
  if (!this.done) {
    // Then we move to the next result, which call the
    // cursor success with the next file as result.
    this.continue();
  }
}

ブラウザ互換性

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatUnknown}} {{CompatGeckoDesktop("21.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatUnknown}} {{CompatUnknown}} {{CompatGeckoMobile("21.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

仕様

Not currently part of any specification.

関連情報