This repository was archived by the owner on Oct 11, 2020. It is now read-only.
File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html >
3
3
< head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta name ="description " content ="Simple website for pretty printing JSON responses. ">
6
+ < meta name ="author " content ="Herman Zvonimir Došilović ">
7
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
8
+
4
9
< script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js " integrity ="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo= " crossorigin ="anonymous "> </ script >
10
+
5
11
< title > JSON Pretty Print</ title >
12
+
6
13
< style >
7
14
# content {
8
15
font-family : 'Courier New' , Courier, monospace;
16
23
var $content = $ ( "#content" ) ;
17
24
var url = location . search . substr ( 1 ) . trim ( ) ;
18
25
if ( url === "" ) {
19
- $content . html ( "<p style=\"color: red;\">Please provide URL.</p> Example: https://jsonpp.judge0.com?<strong>https://api.judge0.com/languages</strong>" ) ;
26
+ $content . html ( "\
27
+ <p style=\"color: red;\">Please provide URL.</p>\
28
+ <p>Example: https://jsonpp.judge0.com?<strong>https://api.judge0.com/languages</strong></p>\
29
+ <small>Source code available on <a href=\"https://github.com/judge0/jsonpp\">GitHub</a>.</small>\
30
+ " ) ;
20
31
}
21
32
else {
22
33
$ . ajax ( {
27
38
$content . html ( JSON . stringify ( data , null , 4 ) ) ;
28
39
}
29
40
else {
30
- $content . html ( "<p style=\"color: red;\" >Response is not a JSON.</p>" ) ;
41
+ $content . html ( "<p>Response is not a JSON.</p>" ) ;
31
42
}
32
43
} ,
33
44
error : function ( jqXHR , textStatus , errorThrown ) {
34
- $content . html ( JSON . stringify ( jqXHR , null , 4 ) ) ;
45
+ $content . html ( `<p> ${ jqXHR . status } </p>` ) ;
35
46
}
36
47
} ) ;
37
48
}
You can’t perform that action at this time.
0 commit comments