This repository was archived by the owner on Nov 1, 2017. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ plus the relevant HTTP Header information.
517517<pre class =" terminal " >
518518$ curl https://api.github.com?callback=foo
519519
520- foo({
520+ /**/ foo({
521521 "meta": {
522522 "status": 200,
523523 "X-RateLimit-Limit": "5000",
@@ -533,14 +533,30 @@ foo({
533533})
534534</pre >
535535
536- You can write a JavaScript handler to process the callback like this :
536+ 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-javascript " >function foo(response) {
538+ <pre ><code class =" language-html " >< ; html>
539+ < ; head>
540+ < ; script type="text/javascript">
541+ function foo(response) {
539542 var meta = response.meta
540543 var data = response.data
541544 console.log(meta)
542545 console.log(data)
543- }</code ></pre >
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+
559+ < ; /html></code ></pre >
544560
545561All of the headers are the same String value as the HTTP Headers with one
546562notable exception: Link. Link headers are pre-parsed for you and come
You can’t perform that action at this time.
0 commit comments