Skip to content
Build a CodePen.io app that is functionally similar to this: https://codepen.io/FreeCodeCamp/full/wGqEga/.
CSS JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css
githubInfo
js
README.md
index.html

README.md

wikipediaViewer

Build a CodePen.io app that is functionally similar to this

My solution hosted at CodePen

Also please click on any of the images below to go to the Github hosted version


Brief:

Objective: Build a CodePen.io app that is functionally similar to this

Fulfill the below user stories. Use whichever libraries or APIs you need. Give it your own personal style.

User Story: I can search Wikipedia entries in a search box and see the resulting Wikipedia entries.

I can click a button to see a random Wikipedia entry.

Hint #1: Here's a URL you can use to get a random Wikipedia article

Hint #2: Here's an entry on using Wikipedia's API

Hint #3: Use this link to experiment with Wikipedia's API.


Solution

enter a general search term for example 'bbc' or click the random search button

a list of 10 clickable links is then produced


Issues

  • realising I could use jquery 'append'

  • scoping the ajax correctly.

  • could have used some templating as there is HTML in the JavaScript but its a small piece of code.

  • used the "event.keyCode==13" for input as in the demo but Im not sure if this was strictly necessary.

  • would idealy have liked more ajax code re-use; a future tidy-up maybe.

You can’t perform that action at this time.