DOMPointReadOnly.toJSON()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
メソッド toJSON()
は、この点オブジェクトの JSON 形式を表すオブジェクトを返します。
構文
js
toJSON();
引数
なし。
返値
プロパティに、メソッドが呼び出された DOMPoint
または DOMPointReadOnly
の値が設定された新しいオブジェクトを返します。
例
この例では、現在のウィンドウの左上隅をスクリーン座標で表す DOMPoint
オブジェクトを作成し、それを JSON に変換しています。
js
var topLeft = new DOMPoint(window.screenX, window.screenY);
var pointJSON = topLeft.toJSON();
仕様書
Specification |
---|
Geometry Interfaces Module Level 1 # dom-dompointreadonly-tojson |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
toJSON() |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.