Wikipedia Viewer

Developer
Size
2,811 Kb
Views
8,096

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 Codoer on 07 December 2022, Wednesday.

Wikipedia Viewer Previews

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 prefetch' href='https://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container-fluid " > <div class="row text-center aligeneral"> <div class="wiki-area"> <h1>Wikipedia Viewer</h1> <form id="form-container">
<div class="input-group"> <input class="form-control" type="search" id="wikiSearch" value="" placeholder="Search..."> <span class="input-group-addon" class="form-control-feedback"> <i class="fa fa-search"></i></span> </div> <a href="https://en.wikipedia.org/wiki/Special:Random" class="btn btn-primary" target="_black">Random Wikipedia</a> </form> <div id="wikiContent"> </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>

Wikipedia Viewer - Script Codes CSS Codes

input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: searchfield-cancel-button;}
body
{ background-color:#008299;
background-size: cover;
height: 2000px;
}
#wikiDiv{ width: 1150px;
background-color:lightgray;
margin-top: 40px;
margin-left: auto; margin-right: auto;
padding-top: 1px;
padding-left: 20px;
padding-right: 10px;
color:black;
padding-bottom: 5px;
border-radius: 10px;
text-align:left;
}
h1{ font-size: 60px; font-weight: bold; color: white; margin: 50px 0;
}
.btn-primary{ margin-top: 40px;
}
#wikiTitle{ color:darkcyan;
}
input[type=search]{
width: 10%;
border-radius: 4px; font-size: 20px;
}
form { width: 20%; margin: auto;
}

Wikipedia Viewer - Script Codes JS Codes

function wiki(data) { var obj=data.query.pages; var HTMLnodes = ""; // build up the results $.map(obj,function(v,i){ HTMLnodes += "<div id='wikiDiv'><a href='https://en.wikipedia.org/wiki/" +v.title+"' target='_blank'><h2 id='wikiTitle'>"+v.title+ "</h2>"+"</a><h4 id='wikiExtract'>" +v.extract+"</h4></div>" }); //remove old search results $("#wikiContent").empty(); //add new results $("#wikiContent").append(HTMLnodes); }
//function pre(event){ event.preventDefault(); }
function loadData() { var wikiUrl="https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=extracts&exintro&explaintext&exsentences=1&exlimit=max&callback=?&gsrsearch=" var value=$("input").val(); $.getJSON(wikiUrl+value, wiki); //pre(event);
}
$("#wikiSearch").on("input",loadData);//when type letter, then shows search result same time;//replace oninput="loadData()"in input tag;
$("#form-container").on("submit",function(e){// replace pre(e); function pre(e){e.preventDefault();}; console.log(e) e.preventDefault();//replace onsubmit="return false" in form tag; //loadData();
})
Wikipedia Viewer - Script Codes
Wikipedia Viewer - Script Codes
Home Page Home
Developer Codoer
Username c0d0er
Uploaded December 07, 2022
Rating 3
Size 2,811 Kb
Views 8,096
Do you need developer help for Wikipedia Viewer?

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!

Codoer (c0d0er) Script Codes
Create amazing art & images with AI!

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!