# Random Quote Generator: MIME type error

**URL:** <https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787>\
**Category:** General\
**Created:** [April 23, 2017, 11:56pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787 "2017-04-23T23:56:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nzldeveloper](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@nzldeveloper](https://forum.freecodecamp.org/u/nzldeveloper)\
**Post date:** [April 23, 2017, 11:56pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/1 "2017-04-23T23:56:56Z")

</div>

Hi everyone,

My random quote generator started giving this error now:

“Refused to execute script from ‘[http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=jQuery311003923957145428081\_1492991504854&\_=1492991504855](http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=jQuery311003923957145428081_1492991504854&_=1492991504855)’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.”

[http://codepen.io/nzldeveloper/pen/rybQjj](http://codepen.io/nzldeveloper/pen/rybQjj)

Can someone let me know why that’s the case? it was working fine last week when I completed it.

Thank you,  
Ning

---

<div class="post-metadata">

**Author:** ![britecourtney](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/britecourtney/32/43594_2.png) [@britecourtney](https://forum.freecodecamp.org/u/britecourtney)\
**Post date:** [April 24, 2017, 4:00am UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/2 "2017-04-24T04:00:03Z")

</div>

I’m having the same issue. Worked perfectly until today. I have tried looking around for an answer on Google and everything indicates it’s something to do with our datatype being wrong, but I can’t figure out how to fix it (or why it would only be a problem starting today when it never had a problem before). Anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![deuscode](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/deuscode/32/37258_2.png) [@deuscode](https://forum.freecodecamp.org/u/deuscode)\
**Post date:** [April 25, 2017, 12:50pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/3 "2017-04-25T12:50:13Z")

</div>

I am having the same issue at [http://kaypeter.com/rqg](http://kaypeter.com/rqg)

It seems to be an issue with response headers being sent by the forismatic api website. It goes and sends a content-type: text/html. But for most people, we use json/jsonp and the browser sees this as a mismatch.

I don’t think there is a solution unless the people at forismatic can set their content-type and/or configure their CORS

 ![](https://global.discourse-cdn.com/freecodecamp/original/3X/2/f/2f5116ba0707f5cb117004ad9ac079c54dd89fee.png)

---

<div class="post-metadata">

**Author:** ![deuscode](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/deuscode/32/37258_2.png) [@deuscode](https://forum.freecodecamp.org/u/deuscode)\
**Post date:** [April 25, 2017, 1:11pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/4 "2017-04-25T13:11:56Z")

</div>

I’ve just emailed the API owner and we’ll see what happens 🙂

---

<div class="post-metadata">

**Author:** ![deuscode](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/deuscode/32/37258_2.png) [@deuscode](https://forum.freecodecamp.org/u/deuscode)\
**Post date:** [April 25, 2017, 1:24pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/5 "2017-04-25T13:24:02Z")

</div>

Just got a response back and bad news, the original API owner does not support the API anymore ☹

 ![](https://global.discourse-cdn.com/freecodecamp/original/3X/9/9/99985c26960674f3632ad6684e45fc9c4ff35cc1.png)

---

<div class="post-metadata">

**Author:** ![deuscode](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/deuscode/32/37258_2.png) [@deuscode](https://forum.freecodecamp.org/u/deuscode)\
**Post date:** [April 25, 2017, 1:41pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/6 "2017-04-25T13:41:05Z")

</div>

Sorry to say,

Forismatic is no longer supported. At all.

Please use a different API.  
 ![](https://global.discourse-cdn.com/freecodecamp/original/3X/b/d/bd4374cad34c1aec6ac3ec235da5087388c0fb90.png)

---

<div class="post-metadata">

**Author:** ![nzldeveloper](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@nzldeveloper](https://forum.freecodecamp.org/u/nzldeveloper)\
**Post date:** [April 25, 2017, 5:46pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/7 "2017-04-25T17:46:55Z")

</div>

Thank you for figuring this all out! I will go find another API I guess.

---

<div class="post-metadata">

**Author:** ![britecourtney](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/britecourtney/32/43594_2.png) [@britecourtney](https://forum.freecodecamp.org/u/britecourtney)\
**Post date:** [April 26, 2017, 12:56am UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/8 "2017-04-26T00:56:23Z")

</div>

Thanks for tracking that down! I already switched to another api, through MASHAPE. You’ve gotta create an API key but it works. Here’s hoping the weather api still works after CodePen changes over completely to secure. 😕

---

<div class="post-metadata">

**Author:** ![deuscode](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/deuscode/32/37258_2.png) [@deuscode](https://forum.freecodecamp.org/u/deuscode)\
**Post date:** [May 5, 2017, 3:57pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/9 "2017-05-05T15:57:06Z")

</div>

Hi fellow campers!

I just received an email from the forismatic API owner, and they stated that they fixed the issue with their content-type. I just tested it and it is working! Happy coding!

PK

---

<div class="post-metadata">

**Author:** ![nzldeveloper](https://avatars.discourse-cdn.com/v4/letter/n/71e660/32.png) [@nzldeveloper](https://forum.freecodecamp.org/u/nzldeveloper)\
**Post date:** [May 5, 2017, 10:44pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/10 "2017-05-05T22:44:42Z")

</div>

Thank you! I was gna go fix it this weekend so this perfect timing haha!

---

<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 16, 2021, 5:59pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-mime-type-error/108787/11 "2021-01-16T17:59:45Z")

</div>

Closed on January 16, 2021, 5:59pm UTC


