DOMPointReadOnly
方法
toJSON()
返回
DOMPointInit
object giving the
JSON
form of the point object.
pointJSON = DOMPointReadOnly.toJSON();
None.
新的
DOMPointInit
object whose properties are set to the values in the
DOMPoint
or
DOMPointReadOnly
on which the method was called.
此范例创建
DOMPoint
object representing the top-left corner of the current window, in screen coordinates, then converts that to JSON.
var topLeft = new DOMPoint(window.screenX, window.screenY); var pointJSON = topLeft.toJSON();
| 规范 | 状态 | 注释 |
|---|---|---|
|
Geometry Interfaces Module Level 1
The definition of 'DOMPointReadOnly.toJSON()' in that specification. |
候选推荐 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
toJSON()
|
Chrome 61 | Edge 79 | Firefox 62 | IE No | Opera 48 | Safari 10.1 | WebView Android 61 | Chrome Android 61 | Firefox Android 62 | Opera Android 45 | Safari iOS 10.3 | Samsung Internet Android 8.0 |
完整支持
不支持
DOMPointReadOnly
fromPoint()
toJSON()
AbortController
AbortSignal
AbstractRange
Attr
ByteString
CDATASection
CSSPrimitiveValue
CSSValue
CSSValueList
CharacterData
ChildNode
注释
CustomEvent
DOMConfiguration
DOMError
DOMErrorHandler
DOMException
DOMImplementation
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMParser
DOMPoint
DOMPointInit
DOMRect
DOMString
DOMTimeStamp
DOMTokenList
DOMUserData
Document
DocumentFragment
DocumentType
元素
ElementTraversal
Entity
EntityReference
事件
EventTarget
HTMLCollection
MutationObserver
节点
NodeFilter
NodeIterator
NodeList
NonDocumentTypeChildNode
ProcessingInstruction
PromiseResolver
范围
StaticRange
文本
TextDecoder
TextEncoder
TimeRanges
TreeWalker
TypeInfo
USVString
UserDataHandler
XMLDocument