A wiki viewer
How do I make an a wiki viewer?
What is a a wiki viewer? How do you make a a wiki viewer? This script and codes were developed by Daniel on 23 October 2022, Sunday.
A wiki viewer - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>a wiki 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> <div class="container"> <div class="row"> <div class="col-md-12"> <div id="content" class="text-center">
<h3><a href="https://en.wikipedia.org/wiki/Special:Random" target="_blank">Click here for random artical</a></h3>
<p>or searching by input the keyword down below</p> <input type="text" id="inputKey" required placeholder="search key..."> <button id="search">search</button> <button id="clear">clear</button> <div id="searchResult"></div> </div> </div> </div> </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>
A wiki viewer - Script Codes CSS Codes
body { background-color: LemonChiffon; color: black;
}
#content { padding: 150px 20px 50px 20px;
}
a, a:visited, a:hover, a:active { color: inherit; text-decoration: none !important;
}
A wiki viewer - Script Codes JS Codes
$(document).ready(function() { //load DOC ready $("#search").click(function() { //click search button $("#searchResult").empty(); //make sure field is clean getWiki(); //call the function to get data from wiki // console.log(getWiki()); }); $("#clear").click(function (){ //click button to clear input value and data $("input").val(" "); $("#searchResult").empty(); }); });
var getWiki = function () { var key = ""; key = $("#inputKey").val(); //get input value and assign to key $.ajax({ //ajax to call value to server url:"https://en.wikipedia.org//w/api.php?action=query&format=json&list=search&continue=&srlimit=10&srwhat=text&srsearch="+key, //wiki API dataType: 'jsonp', success: function(val) { var title = []; var content = []; var regTarget = /\s/g; //regexp: space in the string global var urlTarget; for(var i=0; i<val.query.search.length; i++){ title[i] = val.query.search[i].title; content[i] = val.query.search[i].snippet; urlTarget = title[i].replace(regTarget,"_"); //repace space to '_' // console.log(d); $("#searchResult").append("<a target='_blank' href='https://en.wikipedia.org/wiki/"+urlTarget+"'>"+"<h3>"+title[i]+"</h3></a>" +"<b>"+content[i]+"</b>"); //append data into page } //console.log(val); }, error: function() { //if ajax response fail $("#searchResult").html(" there are some errors, please try again!"); } }); };
//https://en.wikipedia.org/wiki/List_of_numbered_roads_in_Niagara_Region
Developer | Daniel |
Username | twdaniel |
Uploaded | October 23, 2022 |
Rating | 3 |
Size | 2,637 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 |
Tribute | 2,052 Kb |
ShowTLW | 3,314 Kb |
Portfolio | 3,399 Kb |
PracticeQuote | 2,606 Kb |
A Pen by daniel | 2,678 Kb |
Test getlocation | 1,758 Kb |
RandomQuoteMachine | 2,508 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 |
Acorrdian 2016 | Milanodituti | 3,720 Kb |
Simple animated hover effect | Pobee-norris | 3,044 Kb |
Simple Login Form | JoshBlackwood | 4,418 Kb |
Scifi-style Radio-based Tab | Aaronchuo | 4,427 Kb |
Sitemap generator for Sharepoint | Gyusza | 2,518 Kb |
Tab Menus | Zephyr | 3,180 Kb |
Banner Ad | Raquellorenzana | 4,172 Kb |
Pattern lab logo | TimPietrusky | 3,666 Kb |
A Pen by Gregory Potdevin | GregoryPotdevin | 1,713 Kb |
Obligatory CSS3 UI Nav | Romandiaz | 9,017 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!