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

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript