Search completed in 1.31 seconds.
PerformanceEntry.toJSON() - Web APIs
function run_PerformanceEntry() { log("PerformanceEntry support ..."); if (performance.mark === undefined) { log("... ...
... function run_PerformanceEntry() { log("PerformanceEntry support ..."); if (performance.mark === undefined) { log("... ...
... function run_PerformanceEntry() { log("PerformanceEntry support ..."); if (performance.mark === undefined) { log("... ...
...And 3 more matches
performance.toJSON() - Web APIs
Recommendation Defines
toJson(). ...
... Recommendation Defines
toJson(). ...
... Recommendation Defines
toJson(). ...
...is available in Web Workers. Syntax myPerf = performance.
toJSON() Arguments None Return value myPerf A JSON object that is the serialization of the Performance object. Example var js; js = window.performance.
toJSON(); console.log("json = " + JSON.stringify(js)); Specifications Specification Status Comment High Resolution Time Level 2The definition of '
toJSON() serializer' in that specification. Recommendation Defines
toJson(). ...
URL.toJSON() - Web APIs
Living Standard Initial definition. ...
... Living Standard Initial definition. ...
... Living Standard Initial definition. ...
... the URL, although in practice it seems to have the same effect as URL.toString(). Note: This feature is available in Web Workers. Syntax const href = url.
toJSON() Return value A USVString. Examples const url = new URL("/docs/Web/API/URL/toString"); url.
toJSON(); // should return the URL as a string Specifications Specification Status Comment URLThe definition of '
toJSON()' in that specification. Living Standard Initial definition. ...
PaymentAddress.toJSON() - Web APIs
Candidate Recommendation Initial definition. Browser Compatibility 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. ...
... Candidate Recommendation Initial definition. Browser Compatibility 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. ...
...efinition. Browser Compatibility 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. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
toJSON()Chrome Full support 61Disabled Full support 61Disabled Disabled From version 61: this feature is behind the #web-payments preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.Edge Full support 15Firefox F...
PerformanceNavigationTiming.toJSON() - Web APIs
The
toJSON() method is a serializer - it returns a JSON representation of the PerformanceNavigationTiming object. Syntax json = resourcePerfEntry.
toJSON(); Arguments None Return value json A JSON object that is the serialization of the PerformanceNavigationTiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes. ...
...urn value json A JSON object that is the serialization of the PerformanceNavigationTiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes. Example // Get a resource performance entry var perfEntries = performance.getEntriesByType("navigation"); var entry = perfEntries[0]; // Get the JSON and log it var json = entry.
toJSON(); var s = JSON.stringify(json); console.log("PerformanceNavigationTiming.
toJSON() = " + s); Specifications Specification Status Comment Navigation Timing Level 2The definition of '
toJSON()' in that specification. Working Draft Initial definition. ...
PerformanceResourceTiming.toJSON() - Web APIs
The
toJSON() method is a serializer that returns a JSON representation of the PerformanceResourceTiming object. Syntax json = resourcePerfEntry.
toJSON(); Arguments None Return value json A JSON object that is the serialization of the PerformanceResourceTiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes. ...
... Return value json A JSON object that is the serialization of the PerformanceResourceTiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes. Example // Get a resource performance entry var perfEntries = performance.getEntriesByType("resource"); var entry = perfEntries[0]; // Get the JSON and log it var json = entry.
toJSON(); var s = JSON.stringify(json); console.log("PerformanceEntry.
toJSON = " + s); Specifications Specification Status Comment Resource Timing Level 2The definition of '
toJSON' in that specification. Working Draft ...
RTCIceCandidate. toJSON() - Web APIs
The RTCIceCandidate method
toJSON() converts the RTCIceCandidate on which it's called into JSON in the form of an RTCIceCandidateInit object. Syntax json = rtcIceCandidate.
toJSON(); Return value An object conforming to the RTCIceCandidateInit dictionary, whose members' values are set to the corresponding values in the RTCIceCandidate object. You can then get a stringified version of the object by calling stringify() on the returned object. See the example below. Example This simple example obtains a JSON string representing an RTCIceCandidate found in the variable candidate. ...
...ng to the RTCIceCandidateInit dictionary, whose members' values are set to the corresponding values in the RTCIceCandidate object. You can then get a stringified version of the object by calling stringify() on the returned object. See the example below. Example This simple example obtains a JSON string representing an RTCIceCandidate found in the variable candidate. var jsonString = candidate.
toJSON().stringify(); Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCIceCandidate.
toJSON()' in that specification. Candidate Recommendation Initial definition. ...
RTCSessionDescription.toJSON() - Web APIs
The RTCSessionDescription.
toJSON() method generates a JSON description of the object. Both properties, type and sdp, are contained in the generated JSON. Syntax var jsonValue = sd.
toJSON(); The result value is a JSON object containing the following values: "type", containing the value of the RTCSessionDescription.type property and can be one of the following values: "offer", "answer", "pranswer" or null. "sdp", containing a DOMString, or null, with the SDP message corresponding to RTCSessionDescription.sdp property. Example // sd is a RTCSessionDescriptor alert(JSON.stringify(sd)); // This call the
toJSON() method behind the scene. Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCSe...
..., containing a DOMString, or null, with the SDP message corresponding to RTCSessionDescription.sdp property. Example // sd is a RTCSessionDescriptor alert(JSON.stringify(sd)); // This call the
toJSON() method behind the scene. Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCSessionDescription:
toJSON()' in that specification. Candidate Recommendation Initial specification. ...
Date.prototype.toJSON() - JavaScript
The
toJSON() method returns a string representation of the Date object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.
toJSON() Return value A string representation of the given date. Description Date instances refer to a specific point in time. Calling
toJSON() returns a string (using toISOString()) representing the Date object's value. This method is generally intended to, by default, usefully serialize Date objects during JSON serialization. ...
...les and send us a pull request. Syntax dateObj.
toJSON() Return value A string representation of the given date. Description Date instances refer to a specific point in time. Calling
toJSON() returns a string (using toISOString()) representing the Date object's value. This method is generally intended to, by default, usefully serialize Date objects during JSON serialization. Examples Using
toJSON() var jsonDate = (new Date()).
toJSON(); var backToDate = new Date(jsonDate); console.log(jsonDate); //2015-10-26T07:46:36.611Z Specifications Specification ECMAScript (ECMA-262)The definition of 'Date.prototype.
toJSON' in that specification. ...
DOMPointReadOnly.toJSON() - Web APIs
The DOMPointReadOnly method
toJSON() returns a DOMPointInit object giving the JSON form of the point object. Syntax pointJSON = DOMPointReadOnly.
toJSON(); Parameters None. Return value A new DOMPointInit object whose properties are set to the values in the DOMPoint or DOMPointReadOnly on which the method was called. Example This example creates a 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(); Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'DOMPointReadOnly.
toJSON()' in that specification. Candidate Recommendation Initial definition ...
PushSubscription.toJSON() - Web APIs
The
toJSON() method of the PushSubscription interface is a standard serializer: it returns a JSON representation of the subscription properties, providing a useful shortcut. Syntax mySubscription = subscription.
toJSON() Parameters None. Returns A JSON object. It currently only contains the subscription endpoint, as an endpoint member. Example navigator.serviceWorker.ready.then(function(reg) { reg.pushManager.getSubscription().then(function(subscription) { var mySubscription = subscription.
toJSON(); // do something with subscription details }) }); Specifications Specification Status Comment Push APIThe definition of 'PushSubscription:
toJSON' in that specification. Working Draft ...
Index - Web APIs
onally with perspective, whose values cannot be altered by script code. 742 DOMPointReadOnly.fromPoint() API, Coordinates, DOM, DOMPointReadOnly, Geometry, Geometry Interfaces, Method, Point, Reference, Static Method, fromPoint The static DOMPointReadOnly method fromPoint() creates and returns a new DOMPointReadOnly object given a source point. 743 DOMPointReadOnly.
toJSON() API, Coordinates, DOM, DOMPointReadOnly, Geometry, Geometry Interfaces, JSON, Method, Point, Reference,
toJSON The DOMPointReadOnly method
toJSON() returns a DOMPointInit object giving the JSON form of the point object. 744 DOMPointReadOnly.w API, Coordinates, DOM, DOMPointReadOnly, Geometry, Geometry Interfaces, Point, Position, Property, Read-only, Reference, W, persp...
...rnia, or "11" for Lisbon, Portugal). 2910 PaymentAddress.sortingCode API, Address, Payment Request, Payment Request API, Property, Read-only, Reference, Sorting Code, payment, paymentAddress, sortingCode The sortingCode read-only property of the PaymentAddress interface returns a string containing a postal sorting code such as is used in France. 2911 PaymentAddress.
toJSON() API, Payment Request, Payment Request API, PaymentRequest, Property, Reference, paymentAddress,
toJSON The
toJSON() property of the PaymentAddress interface is a standard serializer that returns a JSON representation of the PaymentAddress object's properties. 2912 PaymentCurrencyAmount API, Commerce, Currency, Dictionary, Payment Request, Payment Request API, PaymentCur...
...rformance API The performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds. 2987 performance.setResourceTimingBufferSize() API, Method, Reference, Web Performance The setResourceTimingBufferSize() method sets the browser's resource timing buffer size to the specified number of "resource" performance entry type objects. 2988 performance.
toJSON() API, Method, Performance, Reference The
toJSON() method of the Performance interface is a standard serializer: it returns a JSON representation of the performance object's properties. 2989 Performance API Guide, NeedsContent, Overview, Performance, Web Performance The High Resolution Time standard defines a Performance interface that supports client-side latency m...
...And 8 more matches
JSON.stringify() - JavaScript
o white space is used. Return value A JSON string representing the given value. Exceptions Throws a TypeError ("cyclic object value") exception when a circular reference is found. Throws a TypeError ("BigInt value can't be serialized in JSON") when trying to stringify a BigInt value. Description JSON.stringify() converts a value to JSON notation representing it: If the value has a
toJSON() method, it's responsible to define what data will be serialized. Boolean, Number, and String objects are converted to the corresponding primitive values during stringification, in accord with the traditional conversion semantics. undefined, Functions, and Symbols are not valid JSON values. If any such values are encountered during conversion they are either omitted (when found in an object) o...
...alues are encountered during conversion they are either omitted (when found in an object) or changed to null (when found in an array). JSON.stringify() can return undefined when passing in "pure" values like JSON.stringify(function(){}) or JSON.stringify(undefined). All Symbol-keyed properties will be completely ignored, even when using the replacer function. The instances of Date implement the
toJSON() function by returning a string (the same as date.toISOString()). Thus, they are treated as strings. The numbers Infinity and NaN, as well as the value null, are all considered null. All the other Object instances (including Map, Set, WeakMap, and WeakSet) will have only their enumerable properties serialized. Examples Using JSON.stringify JSON.stringify({}); // '{}' JSO...
...: 1}, 2]])]); // '[{},{},{},{}]' // TypedArray JSON.stringify([new Int8Array([1]), new Int16Array([1]), new Int32Array([1])]); // '[{"0":1},{"0":1},{"0":1}]' JSON.stringify([new Uint8Array([1]), new Uint8ClampedArray([1]), new Uint16Array([1]), new Uint32Array([1])]); // '[{"0":1},{"0":1},{"0":1},{"0":1}]' JSON.stringify([new Float32Array([1]), new Float64Array([1])]); // '[{"0":1},{"0":1}]' //
toJSON() JSON.stringify({ x: 5, y: 6,
toJSON(){ return this.x + this.y; } }); // '11' // Symbols: JSON.stringify({ x: undefined, y: Object, z: Symbol('') }); // '{}' JSON.stringify({ [Symbol('foo')]: 'foo' }); // '{}' JSON.stringify({ [Symbol.for('foo')]: 'foo' }, [Symbol.for('foo')]); // '{}' JSON.stringify({ [Symbol.for('foo')]: 'foo' }, function(k, v) { if (typeof k === 'symbol') { return 'a s...
...And 6 more matches
Using Performance Timeline - Web APIs
() to get all "mark" entries named "Begin" p = performance.getEntriesByName("Begin", "mark"); for (var i=0; i < p.length; i++) { log ("Begin and Mark [" + i + "]"); print_perf_entry(p[i]); } } PerformanceEntry interface The PerformanceEntry interface encapsulates a single performance entry i.e. a single performance metric. This interface has four properties and a JSON serializer (
toJSON(). The following example shows the use of these properties. function print_PerformanceEntry(ev) { var properties = ["name", "entryType", "startTime", "duration"]; // Create a few performance entries performance.mark("Start"); do_work(50000); performance.mark("Stop"); performance.measure("measure-1"); var p = performance.getEntries(); for (var i=0; i < p.length; i++) { log("...
...ntry[" + i + "]"); for (var j=0; j < properties.length; j++) { // check each property in window.performance var supported = properties[j] in p[i]; if (supported) { var pe = p[i]; log("... " + properties[j] + " = " + pe[properties[j]]); } else { log("... ...
...j] in p[i]; if (supported) { var pe = p[i]; log("... " + properties[j] + " = " + pe[properties[j]]); } else { log("... " + properties[j] + " = Not supported"); } } } } This interface also includes a
toJSON() method that returns the serialization of the PerformanceEntry object. The following examples show the use of this method. ...
...And 3 more matches
Using the Performance API - Web APIs
is a discrete point in time. By calling this method before and after a task, the time it takes to do the task can be measured. ...
...tartTime); } Serializing the Performance object JSON serialization of the Performance object is done via the
toJSON() method. In the following example, JSON serialization for the Performance, Performance.timing and Performance.navigation objects is printed in the object element. ...
... serialization of the Performance object is done via the
toJSON() method. In the following example, JSON serialization for the Performance, Performance.timing and Performance.navigation objects is printed in the object element. ...
...tion for the Performance, Performance.timing and Performance.navigation objects is printed in the object element. ...
Dict.jsm
t = new Dict(someJSON); Note: Any String you pass will be assumed to be JSON. Method overview Dict copy(); boolean del(String aKey); Object get(String aKey, [optional] Object aDefault); boolean has(String aKey); Array listitems(); Array listkeys(); Array listvalues(); void set(String aKey, Object aValue); String
toJSON(); String toString(); Properties Attribute Type Description count Number The number of items in the dictionary. items Iterator Returns an iterator over all of the items in the dictionary; each item is returned as a pair (a two-element array) with the first element being the key and the second being the value. Note: The order ...
...ry. Note: The order in which items are returned is arbitrary. Array listvalues(); Parameters None. Return value An array of the values in the dictionary. set() Sets the value for a given key, adding a new key to the dictionary if necessary. void set( String aKey, Object aValue ); Parameters aKey The key whose value is to be set. aValue The value to assign to the given key.
toJSON() Returns a JSON String representation of the dictionary. String
toJSON(); Parameters None. Return value A JSON String representation of the dictionary's key/value pairs. This will be "{}" for an empty dictionary. toString() Returns a string representation of the dictionary. String toString(); Parameters None. Return value A string representation of the dictionary's key/value pairs...
PaymentAddress - Web APIs
Obsolete properties The following properties are obsolete and should no longer be used, but may still be present in some browser versions. PaymentAddress.languageCode Read only A DOMString indicating the language code of the address. This identifies the language in which the address is given, and is intended to aid in localization of the display of the address. Methods PaymentAddress.
toJSON() A standard serializer that returns a JSON representation of the PaymentAddress object's properties. Examples In the following example, the PaymentRequest() constructor is used to create a new payment request, which takes three objects as parameters -- one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bou...
...ency: "USD", value: "0.00" }, selected: true, }, ], }; const options = { requestShipping: true }; async function doPaymentRequest() { const request = new PaymentRequest(supportedInstruments, details, options); // Add event listeners here. // Call show() to trigger the browser's payment flow. const response = await request.show(); // Process payment. ...
Performance - Web APIs
mance entry buffer between two specified marks (known as the start mark and end mark, respectively). Performance.now() Returns a DOMHighResTimeStamp representing the number of milliseconds elapsed since a reference instant. Performance.setResourceTimingBufferSize() Sets the browser's resource timing buffer size to the specified number of "resource" type performance entry objects. Performance.
toJSON() Is a jsonizer returning a json object representing the Performance object. Events Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface. resourcetimingbufferfull Fired when the browser's resource timing buffer is full. Also available via the onresourcetimingbufferfull property. Specifications Specific...
...ning an event listener to the oneventname property of this interface. resourcetimingbufferfull Fired when the browser's resource timing buffer is full. Also available via the onresourcetimingbufferfull property. Specifications Specification Status Comment High Resolution Time Level 2The definition of 'Performance' in that specification. Recommendation Defines
toJson() method. High Resolution TimeThe definition of 'Performance' in that specification. Recommendation Defines now() method. Performance Timeline Level 2The definition of 'Performance extensions' in that specification. Candidate Recommendation Changes getEntries() interface. Performance TimelineThe definition of 'Performance extensions' in that specification. ...
PerformanceEntry - Web APIs
MString representing the type of performance metric such as, for example, "mark". See property page for valid values. PerformanceEntry.startTime Read only A DOMHighResTimeStamp representing the starting time for the performance metric. PerformanceEntry.duration Read only A DOMHighResTimeStamp representing the time value of the duration of the performance event. Methods PerformanceEntry.
toJSON() Returns a JSON representation of the PerformanceEntry object. Example The following example checks all PerformanceEntry properties to see if the browser supports them and if so, write their values to the console. function print_PerformanceEntries() { // Use getEntries() to get a list of all performance entries var p = performance.getEntries(); for (var i=0; i < p.length; i++) { c...
... User Timing Recommendation Adds the PerformanceMark and PerformanceMeasure interfaces as well as the mark and measure values for entryType. Frame Timing Draft Adds the PerformanceFrameTiming interface and the frame value for entryType. Performance Timeline Level 2The definition of 'PerformanceEntry' in that specification. Candidate Recommendation Added
toJSON() serializer method. Performance TimelineThe definition of 'PerformanceEntry' in that specification. Recommendation Initial definition. ...
BigInt - JavaScript
hen values greater than 253 are reasonably expected and not to coerce between the two types. Cryptography The operations supported on BigInts are not constant time. BigInt is therefore unsuitable for use in cryptography. Use within JSON Using JSON.stringify() with any BigInt value will raise a TypeError as BigInt values aren't serialized in JSON by default. ...
...expected and not to coerce between the two types. Cryptography The operations supported on BigInts are not constant time. BigInt is therefore unsuitable for use in cryptography. Use within JSON Using JSON.stringify() with any BigInt value will raise a TypeError as BigInt values aren't serialized in JSON by default. ...
url - Archive of obsolete content
) internally. var urls = require("sdk/url"); console.log(urls.getTLD("http://www.bbc.co.uk/")); // "co.uk" console.log(urls.getTLD("https://developer.mozilla.org/")); // "org" Parameters url : string The URL, as a string. Returns string : The top-level domain for the URL. URL Methods toString() Returns a string representation of the URL. Returns string : The URL as a string.
toJSON() Returns a string representation of the URL. Returns string : The URL as a string. Properties scheme The name of the protocol in the URL, without the trailing ':'. Compare with protocol. For example: var url = require("sdk/url").URL("https://developer.mozilla.org/Add-ons?example=true&visible=yes#top"); console.log(url.scheme); // https userPass The username:password part of the URL, nu...
jspage - Archive of obsolete content
;}});return"{"+a+"}";case"number":case"boolean":return String(b); case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; }return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{
toJSON:function(){return JSON.encode(this);}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(b,a){this.key=b; this.setOptions(a);},write:function(b){b=encodeURIComponent(b);if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; }if(this.options.duratio...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
{ Components.utils.reportError(obj.toSource()); }; SOAPClient.Proxy = url; var body = new SOAPObject(method); body.ns = ns; for (var k in params) { body.appendChild(new SOAPObject(k).val(params[k])); } var req = new SOAPRequest(url, body); req.Action = ns + '#' + method; SOAPClient.SendRequest(req, callback); Diff between jqSOAPClient.js and saSOAPClient.js 42c42 < var jsOut = $.xml
ToJSON(xData.responseXML); --- > var jsOut = XMLObjectifier.xml
ToJSON(xData.responseXML); 46,60c46,62 < $.ajax({ < type: "POST", < url: SOAPClient.Proxy, < dataType: "xml", < processData: false, < data: content, < complete: getResponse, < contentType: SOAPClient.ContentType + "; charset=\"" + SOAPClient.CharSet + "\"", < beforeSend: function(req) { < ...
New in JavaScript 1.8.5 - Archive of obsolete content
Object.freeze() Freezes an object: other code can't delete or change any properties. bug 492844 Object.isFrozen() Determines if an object was frozen. bug 492844 Array.isArray() Checks if a variable is an array. bug 510537 Date.prototype.
toJSON() Returns a JSON format string for a Date object. Function.prototype.bind() Creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments). bug 429507 New ECMAScript5 features get and set operators now allo...
Assert.jsm
ected expected Test reference to evaluate against actual message Short explanation of the expected result deepEqual() The equivalence assertion tests a deep equality relation. We check using the most exact approximation of equality between two objects to keep the chance of false positives to a minimum. JSON.stringify is not designed to be used for this purpose; objects may have ambiguous
toJSON() implementations that would influence the test. undefined deepEqual( actual, expected, message ); Parameters actual Test subject to be evaluated as equivalent to expected, including nested properties expected Test reference to evaluate against actual message Short explanation of the expected result notDeepEqual() The non-equivalence assertion tests for any deep inequality. u...
DOMMatrixReadOnly - Web APIs
containing all 16 elements (m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44) which comprise the matrix. The elements are stored into the array as double-precision floating-point numbers in column-major (colexographical access access or "colex") order. (In other words, down the first column from top to bottom, then the second column, and so forth.) DOMMatrixReadOnly.
toJSON() Returns a JSON representation of the DOMMatrixReadOnly object. DOMMatrixReadOnly.toString() Creates and returns a DOMString object which contains a string representation of the matrix in CSS matrix syntax, using the appropriate CSS matrix notation. See the matrix() CSS function for details on this syntax. For a 2D matrix, the elements a through f are listed, for a total of six values an...
DOMPointInit.w - Web APIs
d (that is, its value may be NaN or +-Infinity). There are two methods which use DOMPointInit: The static function DOMPointReadOnly.fromPoint() takes an object that complies with DOMPointInit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. This method is, by inheritance, also available as DOMPoint.fromPoint(). The DOMPointReadOnly.
toJSON() method returns a DOMPointInit object that describes the same point as the original point. By inheritance, this method is also available as DOMPoint.
toJSON(). This value is assumed to be 1 by default if not included in the DOMPointInit object passed into fromPoint(). Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'w' in...
DOMPointInit.x - Web APIs
s value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be NaN or +-Infinity). If this property is missing when the DOMPointInit object is passed into fromPoint(), the value is assumed to be 0 by default. DOMPointInit is used as an input when calling either DOMPointReadOnly.fromPoint() or DOMPoint.fromPoint(), and is returned by the DOMPointReadOnly.
toJSON() and DOMPoint.
toJSON() methods. Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'x' in that specification. Candidate Recommendation Initial definition ...
DOMPointInit.y - Web APIs
oint(), the value is assumed to be 0 by default. There are two methods which use DOMPointInit: The static function DOMPointReadOnly.fromPoint() takes an object that complies with DOMPointInit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. This method is, by inheritance, also available as DOMPoint.fromPoint(). The DOMPointReadOnly.
toJSON() method returns a DOMPointInit object that describes the same point as the original point. By inheritance, this method is also available as DOMPoint.
toJSON(). Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'y' in that specification. Candidate Recommendation Initial definition ...
DOMPointInit.z - Web APIs
d (that is, its value may be NaN or +-Infinity). There are two methods which use DOMPointInit: The static function DOMPointReadOnly.fromPoint() takes an object that complies with DOMPointInit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. This method is, by inheritance, also available as DOMPoint.fromPoint(). The DOMPointReadOnly.
toJSON() method returns a DOMPointInit object that describes the same point as the original point. By inheritance, this method is also available as DOMPoint.
toJSON(). If this property is missing when the DOMPointInit object is passed into fromPoint(), the value is assumed to be 0 by default. Specifications Specification Status Comment Geometry Interfaces Module Level 1The def...
DOMPointInit - Web APIs
Properties DOMPointInit.x An unrestricted floating-point value indicating the x-coordinate of the point in space. ...
DOMPointReadOnly - Web APIs
oint's depth coordinate, z. DOMPointReadOnly.w Read only The point's perspective value, w. Static methods DOMPointReadOnly.fromPoint() A static method that creates a new DOMPointReadOnly object given the coordinates provided in the specified DOMPointInit object. Methods matrixTransform() Applies a matrix transform specified as a DOMMatrixInit object to the DOMPointReadOnly object.
toJSON() Returns a JSON representation of the DOMPointReadOnly object. Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'DOMPoint' in that specification. Candidate Recommendation Latest spec version is an ED. ...
DOMQuad - Web APIs
p1,p2,p3,p4 Read only are DOMPoint objects for each of the DOMQuad object's four corners. Methods DOMQuad.fromRect() Returns a new DOMQuad object based on the passed set of coordinates. DOMQuad.fromQuad() Returns a new DOMQuad object based on the passed set of coordinates. DOMQuad.getBounds() Returns a DOMRect object with the coordinates and dimensions of the DOMQuad object. DOMQuad.
toJSON() Returns a JSON representation of the DOMQuad object. Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'DOMQuad' in that specification. Candidate Recommendation Initial definition. ...
LargestContentfulPaint - Web APIs
rgestContentfulPaint.loadTime The time the element was loaded. LargestContentfulPaint.size The intrinsic size of the element returned as the area (width * height). LargestContentfulPaint.id The id of the element. This property returns an empty string when there is no id. LargestContentfulPaint.url If the element is an image, the request url of the image. Methods LargestContentfulPaint.
toJSON() Returns the above properties as JSON. Examples The following example shows how to create a PerformanceObserver that listens for largest-contentful-paint entries and logs the LCP value to the console. This example also demonstrates how to include buffered entries (those that ocurred before observer() was called), which is done by setting the buffered option to true. Note that in this examp...
LayoutShift - Web APIs
ed) times the distance fraction (distance moved as a fraction of viewport). LayoutShift.hadRecentInput Returns true if there was a user input in the past 500 milliseconds. LayoutShift.lastInputTime Returns the time of the most recent user input. LayoutShift.sources Returns an array of LayoutShiftAttribution objects with information on the elements that were shifted. Methods LayoutShift.
toJSON() Converts the properties to JSON. Examples The following example shows how to capture layout shifts and log them to the console. Note that in this example data is only sent to the server when the user leaves the tab. // Catch errors since some browsers throw when using the new `type` option. // https://bugs.webkit.org/show_bug.cgi?id=209216 try { let cumulativeLayoutShiftScore = 0; co...
PaymentRequest.prototype.id - Web APIs
ue: "65.00" }, }, }; const request = new PaymentRequest(methodData, details); console.log(request.id); // super-store-order-123-12312 The id is then also available in the PaymentResponse returned from the show() method, but under the requestId attribute. const response = await request.show(); console.log(response.requestId === request.id); // And in serialized form too const json = response.
toJSON(); console.log(json.requestId,response.requestId, request.id); Syntax var id = paymentRequest.id Value A DOMString. Specifications Specification Status Comment Payment Request APIThe definition of 'id' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from struct...
PerformanceEntry.duration - Web APIs
od performance.mark("Begin"); do_work(50000); performance.mark("End"); // Use getEntries() to iterate through the each entry var p = performance.getEntries(); for (var i=0; i < p.length; i++) { log("Entry[" + i + "]"); check_PerformanceEntry(p[i]); } } function check_PerformanceEntry(obj) { var properties = ["name", "entryType", "startTime", "duration"]; var methods = ["
toJSON"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = Not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; ...
PerformanceEntry.name - Web APIs
od performance.mark("Begin"); do_work(50000); performance.mark("End"); // Use getEntries() to iterate through the each entry var p = performance.getEntries(); for (var i=0; i < p.length; i++) { log("Entry[" + i + "]"); check_PerformanceEntry(p[i]); } } function check_PerformanceEntry(obj) { var properties = ["name", "entryType", "startTime", "duration"]; var methods = ["
toJSON"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = Not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; ...
PerformanceEntry.startTime - Web APIs
od performance.mark("Begin"); do_work(50000); performance.mark("End"); // Use getEntries() to iterate through the each entry var p = performance.getEntries(); for (var i=0; i < p.length; i++) { log("Entry[" + i + "]"); check_PerformanceEntry(p[i]); } } function check_PerformanceEntry(obj) { var properties = ["name", "entryType", "startTime", "duration"]; var methods = ["
toJSON"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = Not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; ...
PerformanceEventTiming - Web APIs
ormanceEventTiming.processingStart Returns the time at which event dispatch started. PerformanceEventTiming.processingEnd Returns the time at which the event dispatch ended. PerformanceEventTiming.cancelable Returns the associated event's cancelable attribute. PerformanceEventTiming.target Returns the associated event's last target, if it is not removed. Methods PerformanceEventTiming.
toJSON() Converts the PerformanceEventTiming object to JSON. Examples The following example shows how to use the API for all events: const observer = new PerformanceObserver(function(list) { const perfEntries = list.getEntries().forEach(entry => { // Full duration const inputDuration = entry.duration; // Input delay (before processing event) const inputDelay = en...
PerformanceNavigation - Web APIs
ad button or via the Location.reload() method. TYPE_BACK_FORWARD (2) The page was accessed by navigating into the history. TYPE_RESERVED (255) Any other way. PerformanceNavigation.redirectCount Read only An unsigned short representing the number of REDIRECTs done before reaching the page. Methods The Performance interface doesn't inherit any methods. PerformanceNavigation.
toJSON() Is a jsonizer returning a json object representing the PerformanceNavigation object. Specifications Specification Status Comment Navigation TimingThe definition of 'PerformanceNavigation' in that specification. Recommendation Initial definition. ...
PerformanceNavigationTiming - Web APIs
MHighResTimeStamp representing the time value equal to the time immediately after the user agent finishes the unload event of the previous document. PerformanceNavigationTiming.unloadEventStart Read only A DOMHighResTimeStamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document. Methods PerformanceNavigationTiming.
toJSON() Returns a DOMString that is the JSON representation of the PerformanceNavigationTiming object. Specifications Specification Status Comment Navigation Timing Level 2The definition of 'PerformanceNavigationTiming' in that specification. Working Draft Initial definition. ...
PerformanceResourceTiming - Web APIs
oving any applied content-codings. PerformanceResourceTiming.decodedBodySizeRead only A number that is the size (in octets) received from the fetch (HTTP or cache) of the message body, after removing any applied content-codings. PerformanceResourceTiming.serverTimingRead only An array of PerformanceServerTiming entries containing server timing metrics. Methods PerformanceResourceTiming.
toJSON() Returns a DOMString that is the JSON representation of the PerformanceResourceTiming object. Example See the example in Using the Resource Timing API. Specifications Specification Status Comment Resource Timing Level 1The definition of 'PerformanceResourceTiming' in that specification. Candidate Recommendation Initial definition. ...
PerformanceServerTiming - Web APIs
s. Properties PerformanceServerTiming.descriptionRead only A DOMString value of the server-specified metric description, or an empty string. PerformanceServerTiming.durationRead only A double that contains the server-specified metric duration, or value 0.0. PerformanceServerTiming.nameRead only A DOMString value of the server-specified metric name. Methods PerformanceServerTiming.
toJSON() Returns a DOMString that is the JSON representation of the PerformanceServerTiming object. Example Given a server that sends the Server-Timing header, for example a node.js server like this: const http = require('http'); function requestHandler(request, response) { const headers = { 'Server-Timing': ` cache;desc="Cache Read";dur=23.2, db;dur=53, app;dur=47.2 `.
PerformanceTiming - Web APIs
e load event was sent for the current document. If this event has not yet been sent, it returns 0. PerformanceTiming.loadEventEnd Read only When the load event handler terminated, that is when the load event is completed. If this event has not yet been sent, or is not yet completed, it returns 0. Methods The PerformanceTiming interface doesn't inherit any methods. PerformanceTiming.
toJSON() Returns a JSON object representing this PerformanceTiming object. Specifications Specification Status Comment Navigation TimingThe definition of 'PerformanceTiming' in that specification. Recommendation Initial definition. ...
Performance API - Web APIs
r can represent the value as a time in milliseconds accurate to a millisecond. Methods The Performance interface has two methods. The now() method returns a DOMHighResTimeStamp whose value that depends on the navigation start and scope. If the scope is a window, the value is the time the browser context was created and if the scope is a worker, the value is the time the worker was created. The
toJSON() method returns a serialization of the Performance object, for those attributes that can be serialized. Properties The Performance interface has two properties. The timing property returns a PerformanceTiming object containing latency-related performance information such as the start of navigation time, start and end times for redirects, start and end times for responses, etc. The navigation ...
Performance Timeline - Web APIs
yType The type of performance metric (for example, "mark"). startTime A high resolution timestamp representing the starting time for the performance entry. duration A high resolution timestamp representing the time value of the duration of the performance event. (Some performance entry types have no concept of duration and this value is set to '0' for such types.) This interface includes a
toJSON() method that returns the serialization of the PerformanceEntry object. The serialization is specific to the performance entry's type. Performance observers The performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback fu...
PushSubscription - Web APIs
y An object containing the options used to create the subscription. PushSubscription.subscriptionId Read only A DOMString containing the subscription ID associated with the push subscription. Methods PushSubscription.getKey() Returns an ArrayBuffer which contains the client's public key, which can then be sent to a server and used in encrypting push message data. PushSubscription.
toJSON() Standard serializer -- returns a JSON representation of the subscription properties. PushSubscription.unsubscribe() Starts the asynchronous process of unsubscribing from the push service, returning a Promise that resolves to a Boolean when the current subscription is successfully unregistered. Example navigator.serviceWorker.ready.then(function(reg) { reg.pushManager.getSubscription().t...
RTCIceCandidate - Web APIs
eType enumerated type. usernameFragment Read only A DOMString containing a randomly-generated username fragment ("ice-ufrag") which ICE uses for message integrity along with a randomly-generated password ("ice-pwd"). You can use this string to verify generations of ICE generation; each generation of the same ICE process will use the same usernameFragment, even across ICE restarts. Methods
toJSON() Given the RTCIceCandidate's current configuration,
toJSON() returns a DOMString containing a JSON representation of that configuration in the form of a RTCIceCandidateInit object. Examples For examples, see the article Signaling and video calling, which demonstrates the entire process. Specifications Specification Status Comment WebRTC 1.0: Real-time Communication ...
RTCSessionDescription - Web APIs
ollback This special type with an empty session description is used to roll back to the previous stable state. Methods The RTCSessionDescription doesn't inherit any methods. RTCSessionDescription() This constructor returns a new RTCSessionDescription. The parameter is a RTCSessionDescriptionInit dictionary containing the values to assign the two properties. RTCSessionDescription.
toJSON() Returns a JSON description of the object. The values of both properties, type and sdp, are contained in the generated JSON. Example signalingChannel.onmessage = function (evt) { if (!pc) start(false); var message = JSON.parse(evt.data); if (message.sdp) pc.setRemoteDescription(new RTCSessionDescription(message), function () { // if we received an of...
Resource Timing API - Web APIs
rce Timing API includes two methods that extend the Performance interface. The clearResourceTimings() method removes all "resource" type performance entries from the browser's resource performance entry buffer. The setResourceTimingBufferSize() method sets the resource performance entry buffer size to the specified number of resource performance entries. The PerformanceResourceTiming interface's
toJSON() method returns a JSON serialization of a "resource" type performance entry. Implementation status As shown in the PerformanceResourceTiming interface's Browser Compatibility table, most of these interfaces are broadly implemented by desktop browsers. However, note that some properties have little to no implementation so see each property's "Browser compatibility" section for more specific int...
TransformStream - Web APIs
controller.enqueue(new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength)) else if (Array.isArray(chunk) && chunk.every(value => typeof value === 'number')) controller.enqueue(new Uint8Array(chunk)) else if ('function' === typeof chunk.valueOf && chunk.valueOf() !== chunk) this.transform(chunk.valueOf(), controller) // hack else if ('
toJSON' in chunk) this.transform(JSON.stringify(chunk), controller) break case 'symbol': controller.error("Cannot send a symbol as a chunk part") break case 'undefined': controller.error("Cannot send undefined as a chunk part") default: controller.enqueue(this.textencoder.encode(String(chunk))) break }, flush() { /* do any destructor ...
URL - Web APIs
em, beginning with the leading ? character. searchParams Read only A URLSearchParams object which can be used to access the individual query parameters found in search. username A USVString containing the username specified before the domain name. Methods toString() Returns a USVString containing the whole URL. It is a synonym for URL.href, though it can't be used to modify the value.
toJSON() Returns a USVString containing the whole URL. It returns the same string as the href property. Static methods createObjectURL() Returns a DOMString containing a unique blob URL, that is a URL with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser. revokeObjectURL() Revokes an object URL previously created using URL.createObjectURL(). Usa...
Date - JavaScript
ccording to universal time. Date.prototype.setYear() Sets the year (usually 2-3 digits) for a specified date according to local time. Use setFullYear() instead. Date.prototype.toDateString() Returns the "date" portion of the Date as a human-readable string like 'Thu Apr 12 2018'. Date.prototype.toISOString() Converts a date to a string following the ISO 8601 Extended Format. Date.prototype.
toJSON() Returns a string representing the Date using toISOString(). Intended for use by JSON.stringify(). Date.prototype.toGMTString() Returns a string representing the Date based on the GMT (UTC) time zone. Use toUTCString() instead. Date.prototype.toLocaleDateString() Returns a string with a locality sensitive representation of the date portion of this date based on system settings. Date.protot...