UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

20 lines 3.82 kB
<!DOCTYPE html><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"><meta http-equiv="Content-Language" content="en"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>bot.json</title><link href="dossier.css" rel="stylesheet" type="text/css"><header><div><form><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></header><main><article><div class="codelink"><a href="source/lib/atoms/json.js.src.html#l23">View Source</a></div><h1>namespace bot.json</h1><h2>Functions</h2><div id="parse" class="function"><div><h3>parse(<wbr>jsonStr)<span class="codelink"><a href="source/lib/atoms/json.js.src.html#l79">code »</a></span></h3><p>Parses a JSON string and returns the result.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>jsonStr<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>The string to parse.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><p>The JSON object.</p> </div><div class="fn-details"><div><b>Throws</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></code><dd><p>If the input string is an invalid JSON string.</p> </dl></div></div></div></div><hr class="fn-sep"><div id="stringify" class="function"><div><h3>stringify(<wbr>jsonObj, opt_replacer)<span class="codelink"><a href="source/lib/atoms/json.js.src.html#l69">code »</a></span></h3><p>Converts a JSON object to its string representation.</p> <div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>jsonObj<code>*</code><dd><p>The input object.</p> <dt>opt_replacer<code>?function(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, *): *=</code><dd><p>A replacer function called for each (key, value) pair that determines how the value should be serialized. By default, this just returns the value and allows default serialization to kick in.</p> </dl></div><div class="fn-details"><div><b>Returns</b></div><dl><dt><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>A JSON string representation of the input object.</p> </dl></div></div></div></div><h2>Compiler Constants</h2><div id="NATIVE_JSON" class="property"><dl><dt><a href="source/lib/atoms/json.js.src.html#l42">NATIVE_JSON</a><code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd><p>NATIVE_JSON indicates whether the code should rely on the native <code>JSON</code> functions, if available.</p> <p>The JSON functions can be defined by external libraries like Prototype and setting this flag to false forces the use of Closure&#39;s goog.json implementation. </p><p>If your JavaScript can be loaded by a third_party site and you are wary about relying on the native functions, specify &#34;--define bot.json.NATIVE_JSON&#61;false&#34; to the Closure compiler. </p></dl></div></article><nav><h3><a href="index.html" tabindex="2">Overview</a></h3><div><input type="checkbox" id="nav-modules" checked/><label for="nav-modules"><h3><span class="selectable" tabindex="2">Modules</span></h3></label><div id="nav-modules-view"></div></div><div><input type="checkbox" id="nav-types" checked/><label for="nav-types"><h3><span class="selectable" tabindex="2">Types</span></h3></label><div id="nav-types-view"></div></div><h3><a href="Changes.html" tabindex="2">Changes</a></h3></nav></main><footer><div><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></div></footer><script src="types.js"></script><script src="dossier.js"></script>