Need JS help with HTML on Random Quote Machine

Need JS help with HTML on Random Quote Machine
0

#1

So, here’s my codepen:

I’ve added a few console.log() functions to log to the console for me to confirm the click was registered and the getQ() function is being called. getQ() is being called but I can’t actually get anything after the first console.log() that confirms it was called to work. Can anyone clear up why?


#2

Seems to be fine now. Is it still not working for you, or did you fix it yourself?


#3

It isn’t working for me.


#4

Have you tried both http and https?


#5

I’ve tried both, and the only thing that happens is the alert that confirms the button was clicked and it logs ‘first’ indicating that getQ() was actually called. However, the following code, the $.getJSON() doesn’t appear to execute properly.


#6

It seems to be working on my end now. Were you able to fix it?

When I click the New Quote button, the “clicked” alert appears and the following logs to the console (edit for clarification, this is the Codepen console and not the Chrome console):
“first”
"

Supposing is good, but finding out is better.


"
“nested”

The last two lines are from the getQ callback. Is this what you expect to see/ is this what you are seeing on your end?


#7

I never got the ‘nested’ part of the console logged. However, I was using Chrome on Ubuntu 64-bit. Once I switched to Windows 7, it started working perfectly.

Edit: it stopped working again as soon as I logged into code pen