Random quote machine, API will not return a new quote The Next CEO of Stack OverflowWhen to use double or single quotes in JavaScript?Generate random string/characters in JavaScriptevent.preventDefault() vs. return falseGenerating random whole numbers in JavaScript in a specific range?What is the 'new' keyword in JavaScript?How to randomize (shuffle) a JavaScript array?Open a URL in a new tab (and not a new window) using JavaScriptGenerate random number between two numbers in JavaScriptWhy does ++[[]][+[]]+[+[]] return the string “10”?How do I return the response from an asynchronous call?

Is there a rule of thumb for determining the amount one should accept for a settlement offer?

Mathematica command that allows it to read my intentions

What is a typical Mizrachi Seder like?

Could a dragon use its wings to swim?

What steps are necessary to read a Modern SSD in Medieval Europe?

Calculate the Mean mean of two numbers

That's an odd coin - I wonder why

What happens if you break a law in another country outside of that country?

How to find if SQL server backup is encrypted with TDE without restoring the backup

How to pronounce fünf in 45

Does Germany produce more waste than the US?

How to unfasten electrical subpanel attached with ramset

Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?

Physiological effects of huge anime eyes

Can a PhD from a non-TU9 German university become a professor in a TU9 university?

How to show a landlord what we have in savings?

Planeswalker Ability and Death Timing

Finitely generated matrix groups whose eigenvalues are all algebraic

What does this strange code stamp on my passport mean?

Why can't we say "I have been having a dog"?

Strange use of "whether ... than ..." in official text

Avoiding the "not like other girls" trope?

Read/write a pipe-delimited file line by line with some simple text manipulation

Compensation for working overtime on Saturdays



Random quote machine, API will not return a new quote



The Next CEO of Stack OverflowWhen to use double or single quotes in JavaScript?Generate random string/characters in JavaScriptevent.preventDefault() vs. return falseGenerating random whole numbers in JavaScript in a specific range?What is the 'new' keyword in JavaScript?How to randomize (shuffle) a JavaScript array?Open a URL in a new tab (and not a new window) using JavaScriptGenerate random number between two numbers in JavaScriptWhy does ++[[]][+[]]+[+[]] return the string “10”?How do I return the response from an asynchronous call?










0















So i build entire project in Visual Studio Code, I tested it on Chrome and Explorer and it works, it retrieves a new quote and an author with the press of a button, great i thought time to put it into codepen, nope, doesn’t work. Here is what happens, i am using http://quotesondesign.com/api-v4-0/ to get my quotes, when you put this into a browser you see what it retrieves
http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1
the problem seems that on firefox if you enter this you will get a quote, however, if you enter the same link(note that not refresh the page but use the same link) you will get the same quote, in chrome, however, it will give you a new quote, sooooo i tried to see if it would work if I used codepen on chrome, and it didnt work at all because on chrome codepen the api call wouldnt even retrieve any data. here is a function I am using right now.
my code for getting new function looks like this.



getRandomQuote = event =>
fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')
.then(response => response.json())
.then(data =>
if(data[0].content && data[0].title && data[0].link)
let quote = this.state;
let quoteData=data[0];
quote.content = quoteData.content;
quote.link = quoteData.link;

quote.title = quoteData.title;


this.setState(
quote,
isLoaded:true

)

else
return console.error('No Quote :(')


)






here is a link for my codepen:https://codepen.io/russiandobby/pen/OqaxWW?editors=1111
How can I get it to retrieve new cote?










share|improve this question


























    0















    So i build entire project in Visual Studio Code, I tested it on Chrome and Explorer and it works, it retrieves a new quote and an author with the press of a button, great i thought time to put it into codepen, nope, doesn’t work. Here is what happens, i am using http://quotesondesign.com/api-v4-0/ to get my quotes, when you put this into a browser you see what it retrieves
    http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1
    the problem seems that on firefox if you enter this you will get a quote, however, if you enter the same link(note that not refresh the page but use the same link) you will get the same quote, in chrome, however, it will give you a new quote, sooooo i tried to see if it would work if I used codepen on chrome, and it didnt work at all because on chrome codepen the api call wouldnt even retrieve any data. here is a function I am using right now.
    my code for getting new function looks like this.



    getRandomQuote = event =>
    fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')
    .then(response => response.json())
    .then(data =>
    if(data[0].content && data[0].title && data[0].link)
    let quote = this.state;
    let quoteData=data[0];
    quote.content = quoteData.content;
    quote.link = quoteData.link;

    quote.title = quoteData.title;


    this.setState(
    quote,
    isLoaded:true

    )

    else
    return console.error('No Quote :(')


    )






    here is a link for my codepen:https://codepen.io/russiandobby/pen/OqaxWW?editors=1111
    How can I get it to retrieve new cote?










    share|improve this question
























      0












      0








      0








      So i build entire project in Visual Studio Code, I tested it on Chrome and Explorer and it works, it retrieves a new quote and an author with the press of a button, great i thought time to put it into codepen, nope, doesn’t work. Here is what happens, i am using http://quotesondesign.com/api-v4-0/ to get my quotes, when you put this into a browser you see what it retrieves
      http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1
      the problem seems that on firefox if you enter this you will get a quote, however, if you enter the same link(note that not refresh the page but use the same link) you will get the same quote, in chrome, however, it will give you a new quote, sooooo i tried to see if it would work if I used codepen on chrome, and it didnt work at all because on chrome codepen the api call wouldnt even retrieve any data. here is a function I am using right now.
      my code for getting new function looks like this.



      getRandomQuote = event =>
      fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')
      .then(response => response.json())
      .then(data =>
      if(data[0].content && data[0].title && data[0].link)
      let quote = this.state;
      let quoteData=data[0];
      quote.content = quoteData.content;
      quote.link = quoteData.link;

      quote.title = quoteData.title;


      this.setState(
      quote,
      isLoaded:true

      )

      else
      return console.error('No Quote :(')


      )






      here is a link for my codepen:https://codepen.io/russiandobby/pen/OqaxWW?editors=1111
      How can I get it to retrieve new cote?










      share|improve this question














      So i build entire project in Visual Studio Code, I tested it on Chrome and Explorer and it works, it retrieves a new quote and an author with the press of a button, great i thought time to put it into codepen, nope, doesn’t work. Here is what happens, i am using http://quotesondesign.com/api-v4-0/ to get my quotes, when you put this into a browser you see what it retrieves
      http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1
      the problem seems that on firefox if you enter this you will get a quote, however, if you enter the same link(note that not refresh the page but use the same link) you will get the same quote, in chrome, however, it will give you a new quote, sooooo i tried to see if it would work if I used codepen on chrome, and it didnt work at all because on chrome codepen the api call wouldnt even retrieve any data. here is a function I am using right now.
      my code for getting new function looks like this.



      getRandomQuote = event =>
      fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')
      .then(response => response.json())
      .then(data =>
      if(data[0].content && data[0].title && data[0].link)
      let quote = this.state;
      let quoteData=data[0];
      quote.content = quoteData.content;
      quote.link = quoteData.link;

      quote.title = quoteData.title;


      this.setState(
      quote,
      isLoaded:true

      )

      else
      return console.error('No Quote :(')


      )






      here is a link for my codepen:https://codepen.io/russiandobby/pen/OqaxWW?editors=1111
      How can I get it to retrieve new cote?







      javascript reactjs api






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 at 19:58









      russiandobbyrussiandobby

      12




      12






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Ok, now I feel stupid, after some research i found that it seems that all i had to do is change my request a little bit from



          fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')


          to



           fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1', cache: "reload")


          after i did that, it started to work on all browsers and retriving new quotes, i been banning m had for 2 hours and all it took is less then 1 line to fix itT_T






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55288388%2frandom-quote-machine-api-will-not-return-a-new-quote%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Ok, now I feel stupid, after some research i found that it seems that all i had to do is change my request a little bit from



            fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')


            to



             fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1', cache: "reload")


            after i did that, it started to work on all browsers and retriving new quotes, i been banning m had for 2 hours and all it took is less then 1 line to fix itT_T






            share|improve this answer





























              0














              Ok, now I feel stupid, after some research i found that it seems that all i had to do is change my request a little bit from



              fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')


              to



               fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1', cache: "reload")


              after i did that, it started to work on all browsers and retriving new quotes, i been banning m had for 2 hours and all it took is less then 1 line to fix itT_T






              share|improve this answer



























                0












                0








                0







                Ok, now I feel stupid, after some research i found that it seems that all i had to do is change my request a little bit from



                fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')


                to



                 fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1', cache: "reload")


                after i did that, it started to work on all browsers and retriving new quotes, i been banning m had for 2 hours and all it took is less then 1 line to fix itT_T






                share|improve this answer















                Ok, now I feel stupid, after some research i found that it seems that all i had to do is change my request a little bit from



                fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1')


                to



                 fetch('https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1', cache: "reload")


                after i did that, it started to work on all browsers and retriving new quotes, i been banning m had for 2 hours and all it took is less then 1 line to fix itT_T







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 21 at 20:15

























                answered Mar 21 at 20:09









                russiandobbyrussiandobby

                12




                12





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid …


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55288388%2frandom-quote-machine-api-will-not-return-a-new-quote%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

                    Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?