Random Quote Generator
How do I make an random quote generator?
Pressing a button generates a random quote from Forsimatic.com. What is a random quote generator? How do you make a random quote generator? This script and codes were developed by Tom Brodhead on 19 January 2023, Thursday.
Random Quote Generator - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Random Quote Generator</title> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Random Quote Generator</title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <div class="jumbotron"> <section> <h3>Your social media experience isn't complete without a random quote</h3> <br> <p style="margin-bottom:2em"><button id="generate-quotes">Generate Random Quote</button></p> <p id="quote" style="font-weight:bold; font-style:normal; font-size:16px" ></p> <p id="author" style="font-weight:bold; font-style:italic; font-size:16px"></p> </section> </div>
</div> <script src='https://code.jquery.com/jquery-3.1.1.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Random Quote Generator - Script Codes CSS Codes
body { margin-top: 60px; }
Random Quote Generator - Script Codes JS Codes
var d;d=function(){var a,b;a=function(a){return document.querySelector(a)};b=function(){var b,c;a("#quote").innerHTML="Loading...<br><br><em>(on CodePen this may take some time because of a cross-origin delay)</em>";a("#author").innerHTML="";$.ajax({type:"GET",url:"https://crossorigin.me/https://api.forismatic.com/api/1.0/?format=jsonp&method=getQuote&jsonp=?&lang=en",dataType:"json",success:function(e){b=e.quoteText;c=e.quoteAuthor;""===c&&(c="Unknown");a("#quote").innerHTML=b;a("#author").innerHTML=c},error:function(){console.log("Error retrieving JSON")}})};a("#generate-quotes").addEventListener("click",b,!1);b()};document.addEventListener("DOMContentLoaded",function(){d()});
Developer | Tom Brodhead |
Username | TomCodeCamp |
Uploaded | January 19, 2023 |
Rating | 3 |
Size | 2,295 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 |
A Pen by Tom Brodhead | 1,247 Kb |
Portfolio | 3,942 Kb |
Simon | 5,807 Kb |
Local Weather | 3,152 Kb |
Pomodoro Clock | 4,577 Kb |
Wikipedia Search Engine | 3,121 Kb |
Twitch TV Streamers | 3,211 Kb |
Tic Tac Toe | 5,662 Kb |
Tribute Page | 2,658 Kb |
Calculator | 3,739 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 |
3D flipping card | Ssaakkaa | 2,238 Kb |
JavaScript constructors | Simboonlong | 2,415 Kb |
Word Wrap Algorithm for Multiline Canvas Text | Peterhry | 2,349 Kb |
Image grid with captions | Mchernin34 | 2,222 Kb |
Two Element Typeface | Chrisota | 4,942 Kb |
Three js | Paulq | 2,353 Kb |
Part 19 Bootstrap split button dropdown | Venkatesha | 1,601 Kb |
A Pen by Paul Sullivan | Pwsm50 | 2,349 Kb |
Using Flickr API | MoyArt | 6,761 Kb |
Horizontal Navigation with Floats | Gymratpacks | 5,403 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!