MAD9022 Refactoring Practice
How do I make an mad9022 refactoring practice?
Use this pen to practice wrapping all your JS code in a single namespace. Then use it to try and convert your XMLHttpRequest into a FETCH API call.. What is a mad9022 refactoring practice? How do you make a mad9022 refactoring practice? This script and codes were developed by Mobile Application Design-Development on 10 August 2022, Wednesday.
MAD9022 Refactoring Practice - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>MAD9022 Refactoring Practice</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <section> <h1>Refactoring Code</h1> <p>Use this page as a test for refactoring your JavaScript into a more modular page.</p> <p>Fork the Pen then try to convert the code into a single object called app.</p> <p>Once that works, try to refactor the code again to use "use strict"; and the FETCH API instead of XMLHttpRequest</p> <p>XMLHttpRequest reference - https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#XMLHttpRequest()</p> <p>Fetch API primer - https://davidwalsh.name/fetch</p> <p>Loading JSON data...</p>
</section> <script src="js/index.js"></script>
</body>
</html>
MAD9022 Refactoring Practice - Script Codes CSS Codes
*{ box-sizing:border-box;
}
body{ font-family:Calibri, Helvetica, sans-serif;
}
p:last-child{ font-size: 120%; font-weight: 900;
}
MAD9022 Refactoring Practice - Script Codes JS Codes
function init(){ var xhr = new XMLHttpRequest(); //xhr.open("GET", "http://echo.jsontest.com/username/steve/id/12313/course/mad9022/", true); xhr.open("GET", "http://griffis.edumedia.ca/demo/the-data.json"); xhr.addEventListener("load", gotResponse); xhr.addEventListener("error", failed); xhr.send();
}
function gotResponse( ev ){ document.querySelector("p:last-child").textContent = ev.target.responseText; var data = JSON.parse( ev.target.responseText ); console.dir(data);
}
function failed(ev){ console.log("An error occurred"); console.dir(ev); //look in here for the error message and code
}
document.addEventListener("DOMContentLoaded", init);
Developer | Mobile Application Design-Development |
Username | mad-d |
Uploaded | August 10, 2022 |
Rating | 3 |
Size | 2,315 Kb |
Views | 30,360 |
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 |
Two-Column Form | 2,518 Kb |
MAD9014 Exercise 3 Starters | 3,533 Kb |
Navigation Tabs | 3,053 Kb |
Practice querySelector | 2,512 Kb |
Mad9013 - DOM Manipulation sample | 3,113 Kb |
HTML Modal Windows | 2,995 Kb |
Geolocation | 2,429 Kb |
SVG CSS ViewBox Demo | 2,176 Kb |
MAD9013-Sass Equal Spaced Layout Mixin | 2,538 Kb |
Cordova Cheatsheet | 2,534 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 |
Loader | MikitaLisavets | 3,321 Kb |
Wip elementary os navbar | Nickcolley | 2,993 Kb |
Kut D3 | Jellevrswk | 3,687 Kb |
Sinclair Research Computers | MattCowley | 3,068 Kb |
Animated bar chart | CreativePunch | 3,124 Kb |
Working around OS X Dynamic Scrollbars | Jrjenk | 2,279 Kb |
A Pen by Xand0r | Xand0r | 1,928 Kb |
Pomodoro Timer | Sdas13 | 2,900 Kb |
Zeichensatz | Moklick | 2,058 Kb |
Video mute | Leon9208 | 2,131 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!