Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Callbacks

$ curl https://api.github.com?callback=foo

> /**/foo({
>   "meta": {
>     "status": 200,
>     "X-RateLimit-Limit": "5000",
>     "X-RateLimit-Remaining": "4966",
>     "X-RateLimit-Reset": "1372700873",
>     "Link": [ // pagination headers and other links
>       ["https://api.github.com?page=2", {"rel": "next"}]
>     ]
>   },
>   "data": {
>     // the data
>   }
> })
Comment

callbacks

<html>
<head>
<script type="text/javascript">
function foo(response) {
  var meta = response.meta;
  var data = response.data;
  console.log(meta);
  console.log(data);
}

var script = document.createElement('script');
script.src = 'https://api.github.com?callback=foo';

document.getElementsByTagName('head')[0].appendChild(script);
</script>
</head>

<body>
  <p>Open up your browser's console.</p>
</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: delete multiple nodes in firebase realtime database 
Javascript :: wherein knex 
Javascript :: 9.5. The Accumulator Pattern¶ 
Javascript :: song discord.js 
Javascript :: broadcast channel mdn 
Javascript :: strip add usage api docuemntation 
Javascript :: how to pass argument in onFinish method in antdesign 
Javascript :: movie-trailer usage 
Javascript :: how to redirect from login page to other page if user is already logged in in angular using jwt 
Javascript :: how array sort works internally in javascript 
Javascript :: Snackbar - NOTIFICATIONS INSPIRED BY GOOGLE MATERIAL DESIGN 
Javascript :: create javascript array with no values 
Javascript :: invoke method inside class javascript 
Javascript :: route edit button in laravel ajax 
Javascript :: Unexpected eval or arguments in strict mode 
Javascript :: navigate to another page on vue js button 
Javascript :: Chaining methods in jShell 
Javascript :: javascript make the web browser scroll to the top 
Javascript :: function example 
Javascript :: javascript loop all depths recursive object 
Javascript :: powershell json check if property exists 
Javascript :: livewire afterDomUpdate 
Javascript :: Ajax Mixed content blocked 
Javascript :: extracting script elements 
Javascript :: javascript verbatim string 
Javascript :: <xsl:apply-templates select node text subnodes all 
Javascript :: what does the syntax () = {} mean 
Javascript :: Get mimeType in Javascript 
Javascript :: nodejs app.on connection 
Javascript :: javascript regex tester online 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =