FCC Wiki viewer
How do I make an fcc wiki viewer?
What is a fcc wiki viewer? How do you make a fcc wiki viewer? This script and codes were developed by Victoria on 02 December 2022, Friday.
FCC Wiki viewer - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>FCC Wiki viewer</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wiki-block"> <a class="random-article"> <p>Click here for random Wiki article</p> </a> <p>OR</p> <form class="search"> <input type="text" name="query"/> </form> <div class="query-results"></div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.6.1/lodash.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
FCC Wiki viewer - Script Codes CSS Codes
.wiki-block { text-align: center;
}
body { background-color: grey;
}
.random-article { color: black; text-decoration: none;
}
FCC Wiki viewer - Script Codes JS Codes
$(".random-article").attr({ "href": "http://en.wikipedia.org/wiki/Special:Random", "target": "_blank"
});
const resultsViewer = (r) => { const elements = _.map(_.get(r, ['query', 'pages']) || {}, (v, k) => { const titleElement = $('<div/>').text(v.title); const linkElement = $('<a/>').attr({href: 'https://en.wikipedia.org/?curid=' + k}); linkElement.append(titleElement); const rootElement = $('<div/>'); rootElement.append(linkElement); return rootElement; }); console.warn(elements); const queryResultsElement = $('.query-results').empty(); elements.forEach(e => queryResultsElement.append(e[0]));
}
const searchFunc = (e) => { e.preventDefault(); const url = 'https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=pageimages|extracts&pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch='; const query = $(".search").find('input[name="query"]').val(); $.ajax({method: 'GET', url: url + query, jsonp: 'callback', dataType: 'jsonp', success: resultsViewer });
};
$(".search").on('change', _.debounce(searchFunc, 1000));
Developer | Victoria |
Username | Enieste |
Uploaded | December 02, 2022 |
Rating | 3 |
Size | 2,309 Kb |
Views | 12,144 |
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 |
FCC Recipe Box | 7,585 Kb |
Cube calc | 3,851 Kb |
FCC Tic Tac Toe | 5,602 Kb |
FCC Leaderboard | 3,665 Kb |
D3 paths | 9,943 Kb |
React TODO | 3,320 Kb |
Profile | 3,970 Kb |
FCC Local Weather | 2,076 Kb |
FCC Game of Life | 4,303 Kb |
FCC Random quote machine | 2,085 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 |
A form arranged using automatic placement. | Vikasford | 2,103 Kb |
Polygon Dodecahedron in CSS | Vennsoh | 7,606 Kb |
NgEasyModal | Lorenzodianni | 4,159 Kb |
Beveled corners using CSS border attribute | DawsonMediaD | 2,136 Kb |
A vuejs widget | Chrgl86 | 2,869 Kb |
Nested table email layout | Massimo-cassandro | 2,355 Kb |
Twinkling Stars | Ripley6811 | 2,750 Kb |
A Pen by tugce | Ecgutcnkr | 4,197 Kb |
Pomodoro Clock | Yas46 | 3,328 Kb |
SVG Scalable Text | Said_FD | 1,451 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!