Wikipedia Viewer Project Completed But One Problem!

Wikipedia Viewer Project Completed But One Problem!
0.0 0

#1

The project is completed, I think, to the requirements of FCC. But the app doesn’t seem to do anything when I enter gibberish texts in the input. I did added a fail() function to the getJSON but that doesn’t seem to work. Also, don’t mind the looks and responsiveness of the page :smiley: Didn’t work fully on that. But I love to get a feedback on the functionality of my code. Thanks :slight_smile:

Link: Codepen

POST-NOTE: I did an if-else condition where if non-meaningful texts were entered it would check if fetched json is empty. Is that enough?


#2

For your validation, add this after line 27

var json = JSON.parse(rawJson);
      if (!json[1].length) alert("No Wiki data found!"); // add this

The colours are a bit “trippy” but if that’s what you were going for, I can’t complain.
Good job :+1:

Note: the .fail is for the API call failing.


#3

Thank you! Check my post-note above. I did an if-else check for empty json. Same thing right?


#4

Awesome! But I’d try to limit the number of results too. Right now small popup says I have to choose anything between 5-10 but entering 100 still works.


#5

@J_RO You’re just trying to break it! :stuck_out_tongue:


#6

yes, that’s right!!! I think I should put a limit on it through JS/jQuery! Will work on it by checking length of the input


#7

but it works, right???


#8

I believe so, yes. :rofl::rofl::rofl::rofl::rofl:


#9

Haha guilty! If the only comments we have is minor stuff like this he did good though!


#10

Now, I have put in an if-else so it alerts if user enters wrong numbers!!! Now I feel app is completed. Please see xD


#11

Hey, I did the if-else check on the input number. Now is it ok?


#12

Good job!


#13

Thanks a lot!!! Now I’ll work on a close button to close all the searched articles :blush:


#14

I forgot one important question. The hover on my articles pushes my text to the right due to the border created. I don’t know to work around that(to no affect the text). I did try a margin-left -ve but that creates bad transition


#15

Maybe you can add a transparent border with the same width in the normal state and only have it transition the color on hover? Just guessing here, haven’t looked at your code :slight_smile:


#16

but there’s already a border of 1px in the normal state. :thinking:


#17

Ok, I did make it work by using outline and transparent border-left in normal state. :slight_smile: