Simple App Demonstrating Callbacks & REST API Integration
How do I make an simple app demonstrating callbacks & rest api integration?
Simple App Demonstrating Callbacks & REST API Integration. What is a simple app demonstrating callbacks & rest api integration? How do you make a simple app demonstrating callbacks & rest api integration? This script and codes were developed by Aaron K Saunders on 25 September 2022, Sunday.
Simple App Demonstrating Callbacks & REST API Integration - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple App Demonstrating Callbacks & REST API Integration</title>
</head>
<body> <html>
<head> <title>Simple App - Callbacks - API</title> <!-- see https://getbootstrap.com/css/ --> <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" type="application/javascript"></script>
</head>
<body class="container" onload="doOnLoad()"> <h2>Simple App - Callbacks - API</h2> <div> <h4>Documentation Links for what is covered here</h4> <ul style="font-size:larger"> <li> <a href="https://randomuser.me/" target="_blank"> A free API for generating random user data. Like Lorem Ipsum, but for people. </a> </li> <li> <a href="https://api.jquery.com/jquery.ajax/" target="_blank"> Documentation in jQuery $.ajax </a> </li> <li> <a href="http://www.sitepoint.com/use-jquerys-ajax-function/" target="_blank"> How to Use jQuerys $.ajax() Function </a> </li> </ul> </li> </div> <div> <h4>JSON Object that is the response <code>https://randomuser.me/api/</code> API call</h4> <pre id="response-content"></pre> <pre> <div style="color:red" id="error-content"></div> </pre> </div>
</body>
<!-- FOCUS ONLY ON THE CODE REGARDING CALLBACKS -->
<script type="text/javascript"> /** * success handler, callback function */ function successCallback(_data) { console.log(_data); // this is jquery code to add the response information // to the webpage at the div with the id '#response-content' $('#response-content').text(JSON.stringify(_data, null, 2)); } /** * error handler, callback function */ function errorCallback(_error) { console.log("error: " + _error); // this is jquery code to add the error information // to the webpage at the div with the id '#error-content' $('#error-content').text(JSON.stringify(_error, null, 2)); } /** * this function makes an API call using jQuery $ajax function * additional documentation is provided in the html page * * this function is call when the document is loaded, ie the page * is loaded in the browser */ function doOnLoad() { $.ajax({ url: 'https://randomuser.me/api/', dataType: 'json', success: successCallback, // <= callback function error: errorCallback // <= callback function }); }
</script>
</html>
</body>
</html>
Developer | Aaron K Saunders |
Username | aaronksaunders |
Uploaded | September 25, 2022 |
Rating | 3 |
Size | 2,200 Kb |
Views | 24,288 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Proper way to manage ng-options selections | 2,114 Kb |
Google Map Directive in Ionic | 3,479 Kb |
Using ui-router to control application flow | 3,448 Kb |
Ionic 2 Tabs Starter | 3,059 Kb |
A Pen by aaron k saunders | 4,143 Kb |
Leaflet Map Directive in Ionic | 2,517 Kb |
A Pen by aaron k saunders | 2,286 Kb |
Nested ng-repeat in AngularJS with Checkboxes | 2,600 Kb |
Demo ui-router basic state change | 2,042 Kb |
Angular2 Http Example | 3,851 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Resize image | Happyhj | 1,892 Kb |
Brian The CSS Bee | Jonitrythall | 3,922 Kb |
Bootstrap 3 Price Table | Honglio | 2,655 Kb |
Tree growth tests | Orchard | 3,818 Kb |
Siema - add pagination to prototype | Pawelgrzybek | 2,575 Kb |
Simple Responsive Text | Fbrz | 2,282 Kb |
Slider | Mohammed-fawzy | 2,634 Kb |
Table border-collapse property | Maxds | 1,672 Kb |
Codero Sitemap | S1m0ne | 28,169 Kb |
Classy Blockquote Styling | Andrewwright | 3,212 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!