forked from umbrae/jsonlintdotcom
-
Notifications
You must be signed in to change notification settings - Fork 218
/
Copy pathindex.html
264 lines (254 loc) · 17.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<!DOCTYPE html>
<html>
<head>
<title>JSON Online Validator and Formatter - JSON Lint</title>
<meta charset="utf-8">
<meta name="description" content="JSONLint is the free online validator, json formatter, and json beautifier tool for JSON, a lightweight data-interchange format. You can format json, validate json, with a quick and easy copy+paste.">
<meta name="twitter:card" value="summary">
<meta property="og:title" content="The JSON Validator">
<meta property="og:type" content="website">
<meta property="og:url" content="http://jsonlint.com">
<meta property="og:image" content="icons/icon-hires.png">
<meta property="og:description" content="JSONLint is the free online validator and json formatter tool for JSON, a lightweight data-interchange format. You can format json, validate json, with a quick and easy copy+paste.">
<meta name="robots" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="google-site-verification" content="T1nWWoSoh2qccuR4z4J2MH9AuFVnl7vQHZhmFCzcILM" />
<link rel="shortcut icon" href="icons/favicon.ico">
<link rel="canonical" href="https://jsonlint.com/" />
<link href="icons/apple-touch-icon.png" rel="apple-touch-icon" />
<link href="icons/apple-touch-icon-128x128.png" rel="apple-touch-icon" sizes="128x128" />
<link href="icons/apple-touch-icon-152x152.png" rel="apple-touch-icon" sizes="152x152" />
<link href="icons/apple-touch-icon-167x167.png" rel="apple-touch-icon" sizes="167x167" />
<link href="icons/apple-touch-icon-180x180.png" rel="apple-touch-icon" sizes="180x180" />
<link href="icons/icon-hires.png" rel="icon" sizes="192x192" />
<link rel="preload" href="https://www.googletagservices.com/tag/js/gpt.js" as="script">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4544768715596285" crossorigin="anonymous"></script>
<script data-bsa="optimize" type="text/javascript">
(function(){
var bsa_optimize=document.createElement('script');
bsa_optimize.type='text/javascript';
bsa_optimize.async=true;
bsa_optimize.src='https://cdn4.buysellads.net/pub/jsonlint.js?'+(new Date()-new Date()%600000);
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa_optimize);
})();
</script>
<script>
(function () {
var networks = document.createElement('script');
networks.setAttribute('src', 'https://m.servedby-buysellads.com/monetization.js');
networks.setAttribute('async', 'true');
networks.onload = function () {
if (typeof _bsa !== 'undefined' && _bsa) {
_bsa.init('default', 'CVADT27Y', 'placement:jsonlintcom', {
target: '.bsa-cpc',
align: 'horizontal',
disable_css: 'true'
});
}
window.onload = function() {
if (document.getElementsByClassName("_default_").length > 0) {
document.getElementsByClassName("bsa-ad")[0].style.display = "block";
}
}
}
var head = document.head;
head.insertBefore(networks, head.firstElementChild);
})();
</script>
<script>
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-69209117-1', 'auto');
ga('send', 'pageview');
</script>
<script type="text/javascript">
window.MemberfulOptions = {site: "https://jsonlint.memberful.com"};
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://d35xxde4fgg0cx.cloudfront.net/assets/embedded.js';
setup = function() { window.MemberfulEmbedded.setup(); }
if(s.addEventListener) { s.addEventListener("load", setup, false); } else { s.attachEvent("onload", setup); }
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
</head>
<body>
<div class="bsa-cpc-inline"></div>
<header>
<nav>
<div class="dev-tools-logo">JSON</div>
<div class="logo">
<h1>JSONLint <span class="sub-title">- The JSON Validator</span></h1> </div>
<label for="drop" class="toggle">Menu</label>
<input type="checkbox" id="drop">
<ul class="menu">
<li class="dropdown">
<label for="drop-1" class="toggle">More Developer Tools</label> <a href="#"><span class="three-lines"></span><span class="more-dev">More Developer</span> <span class="more-tools">Tools</span></a>
<input type="checkbox" id="drop-1">
<ul>
<li class="jscompress"><a target="_blank" href="https://jscompress.com/"><strong>JSCompress</strong><br><span class="tagline-title">The JavaScript Compression Tool</span></a></li>
<li class="keygen"><a target="_blank" href="https://randomkeygen.com/"><strong>RandomKeygen</strong><br><span class="tagline-title">The Random Password Generator</span></a></li>
<li class="comp"><a target="_blank" href="https://jsoncompare.com/"><strong>JSONCompare</strong><br><span class="tagline-title">The Advanced JSON Linter</span></a></li>
<li class="dns"><a target="_blank" href="https://dns-lookup.com/"><strong>DNS-Lookup</strong><br><span class="tagline-title">Professional DNS & IP Lookup Tool</span></a></li>
<li class="jsvalidate"><a target="_blank" href="https://validatejavascript.com/"><strong>ValidateJavaScript</strong><br><span class="tagline-title">Quickly Find & Fix JavaScript Errors</span></a></li>
<li class="keygen"><a target="_blank" href="https://colors.to/"><strong>Colors.to</strong><br><span class="tagline-title">Generate color palette codes</span></a></li>
<li class="comp"><a target="_blank" href="https://whatismyip.io/"><strong>What is my IP address?</strong><br><span class="tagline-title">IP Lookup and diagnostic tool</span></a></li>
</ul>
</li>
</ul>
<ul>
<li class="pro-button"><a href="https://jsoncompare.com/" target="_blank"><span class="more-dev">Try the New</span> Pro</a></li>
</ul>
</nav>
</header>
<div class="container">
<div class="top-container">
<!-- /8691100/JSONLint_S2S_Fluid_Header -->
<div class="bsa-fluid-header-1570745438455-7"><div id="bsa-zone_1570746984891-3_123456"></div></div>
</div>
<!-- JSONLint_S2S_Sidebar_ROS_Pos1 -->
<div id="bsa-zone_1605730077127-6_123456" class="sidebar-ad"></div>
<form name="main">
<textarea id="code" name="code" style="display: none;"></textarea>
<div class="validate">
<button type="submit" data-ga="validate">Validate JSON</button>
<button type="reset" data-ga="clear">Clear</button>
<button class="copy" data-ga="copy">Copy</button>
<div class="memberful-button">
<a href="https://jsonlint.memberful.com/checkout?plan=21158" data-ga="support">Support JSONLint for $2/Month</a>
</div>
</div>
</form>
<section id="result-container">
<h3>Results</h3>
<pre id="result" class="error"></pre>
</section>
<!-- bsa-cpc -->
<div class="bsa-ad">
<div class="partner">
<p>JSONLint <strong>Partners</strong></p>
<sub>Check out their products!</sub>
</div>
<div class="bsa-cpc"></div>
</div>
<!-- /bsa-cpc -->
<div class="info">
<h2>About JSONLint Editor</h2>
<p>JSONLint is a validator and reformatter for JSON, a lightweight data-interchange format. Copy and paste, directly type, or input a URL in the editor above and let JSONLint tidy and validate your messy JSON code.</p>
<h2>What Is JSON?</h2>
<p>
JSON (pronounced as Jason), stands for "JavaScript Object Notation," is a human-readable and compact solution to represent a complex data structure and facilitate data interchange between systems.
It's a widespread data format with a diverse range of applications enabled by its simplicity and semblance to readable text. As such, it's used by most but not all systems for communicating data.
</p>
<h2>Why Use JSON?</h2>
<p>
There are several reasons why you should consider using JSON, the key reason being that JSON is independent of your system's programming language,
despite being derived from JavaScript. Not only is JSON language-independent, but it also represents data that speaks common elements of many programming languages, effectively making it into a universal data representation understood by all systems.
</p>
<p>Other reasons include:</p>
<ul>
<li>Readability – JSON is human-readable, given proper formatting.</li>
<li>Compactness – JSON data format doesn't use a complete markup structure, unlike XML.</li>
<li>It's easy to analyze into logical syntactic components, especially in JavaScript.</li>
<li>Countless JSON libraries are available for most programming languages.</li>
</ul>
<h2>Proper JSON Format</h2>
<p>
Using JSON doesn't require any JavaScript knowledge, though having such would only improve your understanding of JSON. And though the knowledge of JavaScript isn't necessary, following specific rules is:
</p>
<ul>
<li>Data is in name/value pairs</li>
<li>Data is separated by commas</li>
<li>Objects are encapsulated within the opening and closing curly brackets</li>
<li>An empty object can be represented by {}</li>
<li>Arrays are encapsulated within opening and closing square brackets</li>
<li>An empty array can be represented by []</li>
<li>A member is represented by a key-value pair, contained in double quotes</li>
<li>Each member should have a unique key within an object structure</li>
<li>The value of a member must be contained in double quotes, if it's a string</li>
<li>Boolean values are represented using the true or false literals in lower case</li>
<li>Number values are represented using double-precision floating-point format and shouldn't have leading zeroes</li>
<li>"Offensive" characters in a string need to be escaped using the backslash character \</li>
<li>Null values are represented by the null literal in lower case</li>
<li>Dates, and similar object types, aren't adequately supported and should be converted to strings</li>
<li>Each member of an object or array value must be followed by a comma, except for the last one</li>
<li>The standard extension for the JSON file is '.json'</li>
<li>The mime type for JSON files is 'application/json'</li>
</ul>
<p>You can achieve proper JSON formatting by following these simple rules. However, if you're unsure about your code, we suggest using JSONLint Validator.</p>
<h2>Why Use JSONLint Validator?</h2>
<p>Programming can be challenging, as it requires enormous attention and excellent knowledge of the programming language, even as simple as JSON. Still, writing codeis tricky, and finding an error in JSON code can be a challenging and time-consuming task.</p>
<p>The best way to find and correct errors while simultaneously saving time is to use an online tool such as JSONLint. JSONLint will check the validity of your JSON code, detect and point out line numbers of the code containing errors. It's an excellent way to correct errors without wasting hours finding a missing coma somewhere inside your code.</p>
<h2>How Does A JSONLint Validator Work?</h2>
<p>JSONLint is an online editor, validator, and reformat tool for JSON, which allows you to directly type your code, copy and paste it, or input a URL containing your code. It will validate your JSON content according to JS standards, informing you of every human-made error, which happens for a multitude of reasons – one of them being the lack of focus.</p>
<p>Using JSONLint, you can quickly find any errors that might've occurred, allowing you to focus more on the rest of your code than on a tiny error itself.</p>
<h2>Tips & Tricks</h2>
<ul>
<li>You can directly input a URL into the editor and JSONLint will scrape it for JSON and parse it.</li>
<li>You can provide JSON to lint in the URL if you link to JSONLint with the <code>"json"</code> parameter. Here's an <a href="http://jsonlint.com/?json=%7B%22hello%22:%20%22world%22%7D" target="_blank">example URL to test</a>.</li>
<li>JSONLint can also be used as a JSON compressor if you add <a href="?reformat=compress"><code>?reformat=compress</code></a> to the URL.</li>
</ul>
<h2>Common Errors</h2>
<ul>
<li>Expecting <code>'STRING'</code> - You probably have an extra comma at the end of your collection. Something like <code>{ "a": "b", }</code></li>
<li>Expecting <code>'STRING'</code>, <code>'NUMBER'</code>, <code>'NULL'</code>, <code>'TRUE'</code>, <code>'FALSE'</code>, <code>'{'</code>, <code>'['</code> - You probably have an extra comma at the end of your list. Something like: <code>["a", "b", ]</code></li>
<li>Enclosing your collection keys in quotes. Proper format for a collection is <code>{ "key": "value" }</code></li>
<li>Make sure you follow <a href="http://www.json.org/" title="Visit JSON.org to learn more" target="_blank">JSON's syntax</a> properly. For example, always use double quotes, always quotify your keys, and remove all callback functions.</li>
</ul>
<h2>Different Results</h2>
<p>If you use a Windows computer you may end up with different results. This is possibly due to the way Windows handles newlines. Essentially, if you have just newline characters <code>(\n)</code> in your JSON and paste it into JSONLint from a Windows computer, it may validate it as valid erroneously since Windows may need a carriage return <code>(\r)</code> as well to detect newlines properly. As a solution, either use direct URL input, or make sure your content's newlines match the architecture your system expects!</p>
<h2>Credits</h2>
<p>Maintained by CircleCell. Thanks to <a href="http://www.crockford.com/" target="_blank">Douglas Crockford</a> of JSON and JS Lint, and <a href="http://zaa.ch/" target="_blank">Zach Carter</a>, who built a <a href="https://github.com/zaach/jsonlint">pure JavaScript implementation</a>. You can download the <a href="https://www.github.com/circlecell/jsonlintdotcom" target="_blank" data-ga="sourceLink">JSONLint source code on GitHub</a>.</p>
</div>
<div class="bottom-container">
<!-- JSONLint Footer -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8400268452481648"
data-ad-slot="3654656999"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</main>
<footer>
© <span id="copy-year">2023</span> JSONLint.com —
<a href="https://www.buysellads.com/buy/detail/266667/zone/1303970" target="_blank" data-ga="advertise">Advertise Here</a>
—
<a href="privacy-policy.html" target="_blank">Privacy</a>
—
<a href="https://whatismyip.io/" target="_blank">What is my ip address?</a>
</footer>
<script>
document.querySelector('#copy-year').textContent = new Date().getFullYear(); // make sure that copyright year is up to date
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://jsonlint.com/"
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebPage",
"name": "JSON Lint",
"description": "JSON Online Validator and Formatter"
}
</script>
</body>
</html>