Wikipedia Viewer
How do I make an wikipedia viewer?
What is a wikipedia viewer? How do you make a wikipedia viewer? This script and codes were developed by Jimmy Lin on 11 December 2022, Sunday.
Wikipedia Viewer - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Wikipedia Viewer</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<div class="container text-center"> <h1> Wikipedia Viewer </h1> <h4>Free Code Camp Project</h4> <a href = "https://en.wikipedia.org/wiki/Special:Random" target="blank"> <img src= http://www.udlcenter.org/sites/udlcenter.org/files/wikipedia.png > </a> <input class="from-control" id="searchTerm"> <button id="search" type="button" class="btn btn-primary"> Submit </button> <ul id = "output"> </ul>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Wikipedia Viewer - Script Codes CSS Codes
h1, h4 { font-family: "Lobster", Times New Roman;
}
Wikipedia Viewer - Script Codes JS Codes
$(document).ready(function(){ //When search is clicked run code $('#search').click(function(){ // Gets search input var searchTerm= $('#searchTerm').val(); //API url with searchTerm var url = "https:en.wikipedia.org/w/api.php?action=opensearch&search="+ searchTerm + "&format=json&callback=?"; $.ajax({ type:"GET", url:url, async:false, dataType: "json", success: function(data){ // get heading console.log(data[3][0]); // get description console.log(data[2][0]); // get link console.log(data[1][0]); $('#output').html(''); for (var i=0; i<data[1].length; i++){ $('#output').prepend("<li><a href= "+data[3][i]+">"+data[1][i] +"</a><p>" +data[2][i]+"</p></li>"); } $("#searchTerm").val(''); }, error: function(errorMessage){ alert("Error") } }); }); $('#searchTerm').keypress(function(e){ if(e.which==13){ $('#search').click(); } });
});
Developer | Jimmy Lin |
Username | odylic |
Uploaded | December 11, 2022 |
Rating | 3 |
Size | 2,333 Kb |
Views | 10,120 |
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 |
Firefly tribute | 2,476 Kb |
RPG Style Text Dialogue | 2,635 Kb |
Tic Tac Toe Game | 2,701 Kb |
Portfolio Trial 1 | 3,730 Kb |
Mark Down Previewer | 3,062 Kb |
Pomodoro Clock | 2,384 Kb |
TwitchTV JSON API 2 | 2,691 Kb |
Simon Game | 3,485 Kb |
Calculator | 2,544 Kb |
Portfolio Template | 2,581 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 |
Wikipedia Viewer | Thomasvaeth | 2,549 Kb |
Twitch.tv API | Ryzokuken | 2,618 Kb |
Virtual vinyl | Davidpanik | 3,474 Kb |
Jochaho Skeleton | Dhanushbadge | 1,689 Kb |
Animated Vertical CSS3 Menu Black | MaCeLMp4 | 2,750 Kb |
Donut Chart example - MorrisJS | Capelo | 2,385 Kb |
How to add Css Fold Notes In Blogger By Askwithloud.com | Askwithloud | 2,280 Kb |
Eunice A | Ejbronze | 2,203 Kb |
Prototype Responsive Homepage | Heyitsolivia | 7,677 Kb |
Lightning | Akm2 | 19,150 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!