Help needed on Random Quote Generator app

Help needed on Random Quote Generator app
0.0 0

#1

Hi! Could someone help me understand why my program stops when I try to do a .getJSON call? This was working for me earlier and I can’t figure out how to debug it. Thanks!


#2

It worked for me, maybe the issue was coming from the server side of the api.


#3

jQuery needed to be included before bootstrapjs.
Open Devtools (F12) and you will see error messages.

bootstrap was also complaining about not having tether.io

Here’s a working pen for you:


#4

Thanks for checking it out for me! It’s still not working on my end, though. Did it generate a random quote for you?


#5

Thanks! I opened the pen that you made for me and I still can’t see the HTML change. I changed the order of the jQuery and bootstrap calls and added the tether.io to mine and the ‘New Quote’ button still won’t trigger .getJSON. I can do console.log() commands before and after the .getJSON and the button will work, but nothing once it hits that function.


#6

I do get different quotes when I click on get quote button.
Settings I changed are under Javascript pen settings:


#7

It works for me now! Thanks @JoolsMcFly and @RougeRedWired! It wasn’t working when I made those changes - I saved and ran it, refreshed the page, and finally when I went into the debug view, it decided to work and now works outside of the debug view. How strange!