About Random Quote Machine

Hi Campers!

I can’t figure out why $.ajax() method doesn’t work in my project but $.getJSON() method works well.

My project..

I spent more than five hours on it, without result.

Please someone who has any clue HELP!

I found a couple issues with that bit of code. First, as per the documentation, the url should be passed in as the first argument, with all other parameters inside of the settings object passed in after that. Secondly, you’re already getting a JSON object back from your request, so there’s no need to call JSON.parse() in your success function. By changing those two things, I was able to get the rest of your code working.

Hope that helped.

Thank you Sakeran! I don’t understand why it did not work before because I tested this issue you advised. But now it works.