Random Quote Machine Exercise
How do I make an random quote machine exercise?
What is a random quote machine exercise? How do you make a random quote machine exercise? This script and codes were developed by Nathaniel Horwitz-Willis on 06 December 2022, Tuesday.
Random Quote Machine Exercise - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Random Quote Machine Exercise</title>
</head>
<body> <html lang="en">
<head> <meta charset="UTF-8"> <title>Random Quote Machine</title> <meta name="description" content="Random Quote Generator"> <meta name="author" content="Aung Myo Kyaw"> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.1/animate.min.css"> <script type="text/javascript" src="js/index.js"></script> <link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body> <div class="container"> <h1><a href="">Random Quote Machine</a></h1> <p id="quote"></p> <p id="author"></p> <input type="button" id="new" value="New Quote"> <input type="button" id="tweet" value="Tweet"> <p class="credit">By Nate Horwitz-Willis</p> </div>
</body>
</html> <script src="js/index.js"></script>
</body>
</html>
Random Quote Machine Exercise - Script Codes JS Codes
$(document).ready(function() { var errorMessage={message:"Unable to get data ! Please Try Again !",by:"Nate Horwitz-Willis"}; function getQuote(){ $.ajax({ url:'https://andruxnet-random-famous-quotes.p.mashape.com/', type:'POST', dataType:'json', success:function(data){ $("#quote").html('"'+data.quote+'"'); $("#author").html(data.author); $("a.twitter-share-button").attr("data-text",data.quote); $("#quote,#author").addClass('animated bounceInLeft'); $("#quote,#author").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){ $("#quote,#author").removeClass('animated bounceInLeft'); }); }, error:function(error){ $("#quote").html(errorMessage.message); $("#author").html(errorMessage.by); }, beforeSend:function(xhr){ xhr.setRequestHeader("X-Mashape-Authorization", "PSKgJRegHBmsh1A157uuoGMhkUpxp1hW4VQjsn5BUUBMMF18AH"); } }); } getQuote(); $("#new").click(function() { getQuote(); }); $("#tweet").click(function() { var curQuote=$("#quote").html(); var curAuthor=$("#author").html(); var url='https://twitter.com/intent/tweet?text=' + encodeURIComponent(curQuote+"\n"+curAuthor); window.open(url) });
});
Developer | Nathaniel Horwitz-Willis |
Username | natewillisii |
Uploaded | December 06, 2022 |
Rating | 3 |
Size | 2,281 Kb |
Views | 8,096 |
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 |
Show the local weather exercise | 2,788 Kb |
Twitch Exercise | 3,006 Kb |
Wikipedia Viewer Exercise | 3,314 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 |
Fluid Grid 12 | Alexoliverwd | 2,309 Kb |
Header | Er40 | 1,542 Kb |
Pure CSS Read More Arrow | Zephyr | 1,747 Kb |
CSS Link Icons with jQuery Titles | Nicwinn | 2,312 Kb |
Simple Carousel Pure CSS | Dangvanthanh | 4,080 Kb |
Animate a paper plane along an SVG path, looking ahead | PotatoDie | 3,734 Kb |
SlideupBoxes | Gavra | 23,772 Kb |
Header Line Issue | Charlie-volpe | 1,768 Kb |
Promodoro | Bencarp | 1,712 Kb |
Delete Hover | Chungman93 | 2,557 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!