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(); } });
});
![Wikipedia Viewer - Script Codes](http://shots.codepen.io/odylic/pen/aBoBQQ-512.jpg)
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 |
Simon Game | 3,485 Kb |
TwitchTV JSON API 2 | 2,691 Kb |
Portfolio Trial 1 | 3,730 Kb |
Random Quote Generator | 2,674 Kb |
Twitch JSON API | 2,556 Kb |
Tic Tac Toe Game | 2,701 Kb |
Mark Down Previewer | 3,062 Kb |
Firefly tribute | 2,476 Kb |
Calculator | 2,544 Kb |
Pomodoro Clock | 2,384 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 |
Portfolio Layout Flex | Lahvjal | 3,489 Kb |
Blank Starter | Mhartington | 2,171 Kb |
Css3 loader | Clknap | 2,391 Kb |
Loader | MikitaLisavets | 3,321 Kb |
A Pen by Tosh | Panev | 2,586 Kb |
Side Sliding Menu CSS | EduardL | 4,388 Kb |
STAR WARS LIGHTSABER | Francoiscoron | 4,420 Kb |
Weather App | Kw7oe | 3,162 Kb |
CSS Heart Loaders | Nourabusoud | 2,161 Kb |
Update CSS Variables with JS | Wesbos | 2,335 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!