Search completed in 2.10 seconds.
57 results for "toJSON":
Your results are loading. Please wait...
PerformanceEntry.toJSON() - Web APIs
the tojson() method is a serializer; it returns a json representation of the performance entry object.
... syntax json = perfentry.tojson(); arguments none return value json a json object that is the serialization of the performanceentry object.
... example the following example shows the use of the tojson() method.
...And 3 more matches
PaymentAddress.toJSON() - Web APIs
the tojson() property of the paymentaddress interface is a standard serializer that returns a json representation of the paymentaddress object's properties.
... syntax var json = paymentaddress.tojson() parameters none.
... specifications specification status comment web idlthe definition of 'tojson()' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettojson()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).
performance.toJSON() - Web APIs
the tojson() method of the performance interface is a standard serializer: it returns a json representation of the performance object's properties.
... 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().
RTCSessionDescription.toJSON() - Web APIs
the rtcsessiondescription.tojson() method generates a json description of the object.
... 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.
... 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.
Date.prototype.toJSON() - JavaScript
the tojson() method returns a string representation of the date object.
... syntax dateobj.tojson() return value a string representation of the given date.
...calling tojson() returns a string (using toisostring()) representing the date object's value.
... 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.
... 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.
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.
... 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.
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.
... 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.
PerformanceServerTiming.toJSON - Web APIs
the tojson() method of the performanceservertiming interface returns a domstring that is the json representation of the performanceservertiming object.
... syntax var json = performanceservertiming.tojson() parameters none.
... specifications specification status comment server timingthe definition of 'tojson' in that specification.
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.
... 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.
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.
... var jsonstring = candidate.tojson().stringify(); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.tojson()' in that specification.
URL.toJSON() - Web APIs
WebAPIURLtoJSON
the tojson() method of the url interface returns a usvstring containing a serialized version of the url, although in practice it seems to have the same effect as url.tostring().
... 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.
Index - Web APIs
WebAPIIndex
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.
... 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.
... 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.
...And 8 more matches
JSON.stringify() - JavaScript
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.
... the instances of date implement the tojson() function by returning a string (the same as date.toisostring()).
...: 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 2 more matches
Dict.jsm
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.
... tojson() returns a json string representation of the dictionary.
... string tojson(); parameters none.
Using Performance Timeline - Web APIs
this interface has four properties and a json serializer (tojson().
..." + properties[j] + " = not supported"); } } } } this interface also includes a tojson() method that returns the serialization of the performanceentry object.
... function perfentry_tojson() { // create a few performance entries performance.mark("mark-1"); performance.mark("mark-2"); performance.measure("meas-1", "mark-1", "mark-2"); var pelist = performance.getentries(); var pe = pelist[0]; if (pe.tojson === undefined) { log ("performanceentry.tojson() is not supported"); return; } // print the performanceentry object var json = pe.tojson(); var s = json.stringify(json); log("performanceentry.tojson = " + s); } 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 callb...
DOMPointInit.w - Web APIs
WebAPIDOMPointInitw
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().
DOMPointInit.y - Web APIs
WebAPIDOMPointInity
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().
DOMPointInit.z - Web APIs
WebAPIDOMPointInitz
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().
PaymentAddress - Web APIs
methods paymentaddress.tojson() a standard serializer that returns a json representation of the paymentaddress object's properties.
... const json = response.tojson(); const httpresponse = await fetch("/pay/", { method: "post", body: json }); const result = httpresponse.ok ?
Performance - Web APIs
performance.tojson() is a jsonizer returning a json object representing the performance object.
... recommendation defines tojson() method.
PerformanceEntry - Web APIs
methods performanceentry.tojson() returns a json representation of the performanceentry object.
... candidate recommendation added tojson() serializer method.
Using the Performance API - Web APIs
function calculate_time() { var starttime; var endtime; starttime = performance.now(); do_task(); endtime = performance.now(); return (endtime - starttime); } serializing the performance object json serialization of the performance object is done via the tojson() method.
... function print_json() { var json; var o = document.getelementsbytagname("output")[0]; if (window.performance.tojson === undefined) { json = "window.performance.tojson() is not supported"; o.innerhtml += json + "<br>"; } else { var s; json = window.performance.tojson(); // print the performance object s = json.stringify(json); o.innerhtml = "<p>performance = " + s + "</p>"; // print the performance.timing and performance.navigation objects var perf = json.parse(s); var timing = perf.timing; o.innerhtml += "<p>peformance.timing = " + json.stringify(timing) + "</p>"; var navigation = p...
url - Archive of obsolete content
tojson() returns a string representation of the url.
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 = $.xmltojson(xdata.responsexml); --- > var jsout = xmlobjectifier.xmltojson(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
bug 510537 date.prototype.tojson() returns a json format string for a date object.
Assert.jsm
json.stringify is not designed to be used for this purpose; objects may have ambiguous tojson() implementations that would influence the test.
DOMMatrixReadOnly - Web APIs
(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.
DOMPointInit.x - Web APIs
WebAPIDOMPointInitx
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.
DOMPointInit - Web APIs
it's used as the return value when calling tojson().
DOMPointReadOnly - Web APIs
tojson() returns a json representation of the dompointreadonly object.
DOMQuad - Web APIs
WebAPIDOMQuad
domquad.tojson() returns a json representation of the domquad object.
LargestContentfulPaint - Web APIs
methods largestcontentfulpaint.tojson() returns the above properties as json.
LayoutShift - Web APIs
methods layoutshift.tojson() converts the properties to json.
PaymentRequest.prototype.id - Web APIs
WebAPIPaymentRequestid
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.
PaymentRequest.shippingOption - Web APIs
he total request.onshippingoptionchange = ev => { const shippingoption = shippingoptions.find( option => option.id === request.id ); const newtotal = { currency: "usd", label: "total due", value: calculatenewtotal(shippingoption), }; ev.updatewith({ ...details, total: newtotal }); }; async function checkshipping(request) { try { const json = request.shippingaddress.tojson(); await ensurecanshipto(json); const { shippingoptions, total } = await calculateshipping(json); return { ...details, shippingoptions, total }; } catch (err) { return { ...details, error: `sorry!
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
methods performanceeventtiming.tojson() converts the performanceeventtiming object to json.
PerformanceNavigation - Web APIs
performancenavigation.tojson() is a jsonizer returning a json object representing the performancenavigation object.
PerformanceNavigationTiming - Web APIs
methods performancenavigationtiming.tojson() returns a domstring that is the json representation of the performancenavigationtiming object.
PerformanceResourceTiming - Web APIs
methods performanceresourcetiming.tojson() returns a domstring that is the json representation of the performanceresourcetiming object.
PerformanceServerTiming - Web APIs
methods performanceservertiming.tojson() returns a domstring that is the json representation of the performanceservertiming object.
PerformanceTiming - Web APIs
performancetiming.tojson() returns a json object representing this performancetiming object.
Performance API - Web APIs
the tojson() method returns a serialization of the performance object, for those attributes that can be serialized.
Performance Timeline - Web APIs
(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.
PushSubscription - Web APIs
pushsubscription.tojson() standard serializer — returns a json representation of the subscription properties.
RTCIceCandidate - Web APIs
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.
RTCIceCandidateInit - Web APIs
it's also used as the return value from the rtcicecandidate.tojson() method, and can be passed directly into rtcpeerconnection.addicecandidate() to add a candidate to the peer connection.
RTCSessionDescription - Web APIs
rtcsessiondescription.tojson() returns a json description of the object.
Resource Timing API - Web APIs
the performanceresourcetiming interface's tojson() method returns a json serialization of a "resource" type performance entry.
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
WebAPIURL
tojson() returns a usvstring containing the whole url.
BigInt - JavaScript
however, you can implement your own tojson method if needed: bigint.prototype.tojson = function() { return this.tostring() } instead of throwing, json.stringify now produces a string like this: json.stringify(bigint(1)) // '"1"' examples calculating primes // returns true if passed bigint is a prime number function isprime(p) { for (let i = 2n; i * i <= p; i++) { if (p % i === 0n) return false; } return true } // takes a...
Date - JavaScript
date.prototype.tojson() returns a string representing the date using toisostring().