Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Random Quote Machine CodePen does not work #94

Closed
wjhurley opened this issue May 17, 2017 · 3 comments
Closed

Random Quote Machine CodePen does not work #94

wjhurley opened this issue May 17, 2017 · 3 comments

Comments

@wjhurley
Copy link

Issue Description

After clicking on the link for the Random Quote Machine example (https://codepen.io/FreeCodeCamp/full/ONjoLe/), you arrive at a broken app. The "New Quote" and Twitter buttons do nothing. You can reproduce it by either going directly to the link I provided for the CodePen app or by clicking on the link from the FCC page https://www.freecodecamp.com/challenges/build-a-random-quote-machine

Browser Information

  • Browser Name, Version: Chrome Version 57.0.2987.133
  • Operating System: Windows 10
  • Mobile, Desktop, or Tablet: Laptop

Your Code / Link to Your Pen

I pasted the line of code that it causing the problem in the example pen. The link to my forked pen with the fix is https://codepen.io/Wjhurley/pen/NjBEod

 var r = JSON.parse(response);
 
 

Screenshot

image

@no-stack-dub-sack
Copy link
Member

no-stack-dub-sack commented May 19, 2017

@wjhurley hmmm, try again maybe? The app is definitely not broken. New quotes and twitter buttons both work fine for me! It could be that the API that's being used to fetch the quotes was experiencing some down time.

Let me know if this is solved on your end as well.

Thanks.

EDIT: your fork also works fine

@wjhurley
Copy link
Author

My fork worked when I originally submitted this issue. That was why I created the fork, to show the solution to the problem. The app does work now. That is because someone fixed the code. The JSON.parse() function is now wrapped in an if statement and a Tumblr link has been added.

@no-stack-dub-sack
Copy link
Member

@wjhurley yup, you're right. The pen was recently edited. Something must have changed with the API because this app had been working for over a year just fine prior to this. There is one more place where the code needs to be updated on freeCodeCamp's CodePen, so thanks for pointing this out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants