Just finished my wikipedia viewer, I would really love some reviews
- You have unclosed
divin your HTML (<div class="container">is not closed). - If you wrap
inputandbuttonwithtype="submit"informtag your input field will react to Enter (in this case you’ll need to prevent page refresh on submit with JavaScript). - If result contains apostrophe (
'), the generated URL is incorrect (search for “cat” and click on “Schrödinger’s cat”).
I suggest you to use template literals instead of concatenation with+. Like this:
$('.results').append(`<div class="result-title"><a href="${link}">${res.title}</a></div>`);
- You have Off-by-on error in your
forloop.
Fixed version:
1 Like
Am really grateful for the feedback and for fixing the bug. Thanks @jenovs