Skip to content

Commit ad17e17

Browse files
committed
Update the parsing of JSON-P callback example
The current parsing of the JSON-P example is broken (presumable due to the JS) and to resolve it, the code just needs to be treated as regular markdown code and not the specific code classes.
1 parent 8009dff commit ad17e17

1 file changed

Lines changed: 21 additions & 22 deletions

File tree

content/v3.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -535,28 +535,27 @@ $ curl https://api.github.com?callback=foo
535535

536536
You can write a JavaScript handler to process the callback. Here's a minimal example you can try out:
537537

538-
<pre><code class="language-html">&lt;html>
539-
&lt;head>
540-
&lt;script type="text/javascript">
541-
function foo(response) {
542-
var meta = response.meta
543-
var data = response.data
544-
console.log(meta)
545-
console.log(data)
546-
}
547-
548-
var script = document.createElement('script');
549-
script.src = 'https://api.github.com?callback=foo'
550-
551-
document.getElementsByTagName('head')[0].appendChild(script);
552-
&lt;/script>
553-
&lt;/head>
554-
555-
&lt;body>
556-
&lt;p>Open up your browser's console.&lt;/p>
557-
&lt;/body>
558-
559-
&lt;/html></code></pre>
538+
<html>
539+
<head>
540+
<script type="text/javascript">
541+
function foo(response) {
542+
var meta = response.meta;
543+
var data = response.data;
544+
console.log(meta);
545+
console.log(data);
546+
}
547+
548+
var script = document.createElement('script');
549+
script.src = 'https://api.github.com?callback=foo';
550+
551+
document.getElementsByTagName('head')[0].appendChild(script);
552+
</script>
553+
</head>
554+
555+
<body>
556+
<p>Open up your browser's console.</p>
557+
</body>
558+
</html>
560559

561560
All of the headers are the same String value as the HTTP Headers with one
562561
notable exception: Link. Link headers are pre-parsed for you and come

0 commit comments

Comments
 (0)