Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

DOMCursor

この翻訳は不完全です。英語から この記事を翻訳 してください。

非標準
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

概要

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

属性

DOMCursor.done
最後の要素に達しているかを示します。

Inherited from DOMRequest:

DOMRequest.onsuccess
A callback handler called when the operation represented by the DOMRequest is completed.
DOMRequest.onerror
A callback handler that gets called when an error occurs while processing the operation.
DOMRequest.readyState
A string indicating whether or not the operation is finished running. Its value is either "done" or "pending".
DOMRequest.result
The operation's result.
DOMRequest.error
Error information, if any.

メソッド

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();
  }
}

ブラウザ互換性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 21.0 (21.0) ? ? ?
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? 21.0 (21.0) ? ? ?

仕様

Not currently part of any specification.

関連情報

ドキュメントのタグと貢献者

 このページの貢献者: mantaroh, khalid32, chikoski
 最終更新者: mantaroh,