# About Random Quote Machine

**URL:** <https://forum.freecodecamp.org/t/about-random-quote-machine/95834>\
**Category:** General\
**Created:** [March 12, 2017, 1:20am UTC](https://forum.freecodecamp.org/t/about-random-quote-machine/95834 "2017-03-12T01:20:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VitaliiPobujanschii](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@VitaliiPobujanschii](https://forum.freecodecamp.org/u/VitaliiPobujanschii)\
**Post date:** [March 12, 2017, 1:20am UTC](https://forum.freecodecamp.org/t/about-random-quote-machine/95834/1 "2017-03-12T01:20:47Z")

</div>

Hi Campers!

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

[My project.](http://codepen.io/SPVitalii/pen/bqqXgB?editors=1111).

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

Please someone who has any clue HELP!

---

<div class="post-metadata">

**Author:** ![Sakeran](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sakeran/32/163236_2.png) [@Sakeran](https://forum.freecodecamp.org/u/Sakeran)\
**Post date:** [March 12, 2017, 3:12am UTC](https://forum.freecodecamp.org/t/about-random-quote-machine/95834/2 "2017-03-12T03:12:51Z")

</div>

I found a couple issues with that bit of code. First, as per the [documentation](http://api.jquery.com/jquery.ajax/), 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.

---

<div class="post-metadata">

**Author:** ![VitaliiPobujanschii](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@VitaliiPobujanschii](https://forum.freecodecamp.org/u/VitaliiPobujanschii)\
**Post date:** [March 12, 2017, 10:05am UTC](https://forum.freecodecamp.org/t/about-random-quote-machine/95834/3 "2017-03-12T10:05:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:51pm UTC](https://forum.freecodecamp.org/t/about-random-quote-machine/95834/4 "2021-01-17T20:51:28Z")

</div>

Closed on January 17, 2021, 8:51pm UTC


