How to create a basic progress bar with ajax, when I click add to cart in Magento 2?How to refresh Cart using...

Does splitting a potentially monolithic application into several smaller ones help prevent bugs?

PTIJ: Why can't I eat anything?

How did Alan Turing break the enigma code using the hint given by the lady in the bar?

Space in array system equations

What Happens when Passenger Refuses to Fly Boeing 737 Max?

How much attack damage does the AC boost from a shield prevent on average?

"One can do his homework in the library"

How are such low op-amp input currents possible?

Good for you! in Russian

How could our ancestors have domesticated a solitary predator?

A three room house but a three headED dog

Why does the negative sign arise in this thermodynamic relation?

Why the color red for the Republican Party

Virginia employer terminated employee and wants signing bonus returned

Are babies of evil humanoid species inherently evil?

Could a cubesat be propelled to the moon?

How strictly should I take "Candidates must be local"?

How does airport security verify that you can carry a battery bank over 100 Wh?

Algorithm to convert a fixed-length string to the smallest possible collision-free representation?

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Solving "Resistance between two nodes on a grid" problem in Mathematica

MTG: Can I kill an opponent in response to lethal activated abilities, and not take the damage?

Do items de-spawn in Diablo?

Why is there a voltage between the mains ground and my radiator?



How to create a basic progress bar with ajax, when I click add to cart in Magento 2?


How to refresh Cart using PHTML file with AJAX Magento?Basic question: How to add javascript functionality to a page?Trying to run an AJAX script from the admin area in magentoMagento 2.1 - Cancel an order [ configurable product ] issueHow to use Ajax in magento 2 custom moduleCreate order with a AJAX call based on Javascript arrayHow to get pop up on button click popup with ajax callAjax cart validation on change qtyMagento 2 : How to improve ajax call?AJAX login, how to pass data response from controller to jQuery with Ajax













4















I try to make a basic progress bar with ajax , when I click button add to cart, but I don't know how catch the xhr on console,to put on alert() or prepend()function




I follow a video example in youtube, with XMLHttpRequest() function but I see doesn't work




see the code:



var xhr = new XMLHttpRequest();

xhr.upload.addEventListener('progress', ProgressHandler ,false);
xhr.addEventListener('load', CompleteHandler,false);
xhr.addEventListener('error', errorHandler,false);
xhr.addEventListener('abort',LoadHandler,false);


xhr.open("POST","/test/checkout/cart/add/uenc/aHR0cDovLzQ1Ljc5LjE0Ni4yMS90ZXN0L3Rlc3RpbmcuaHRtbA%2C%2C/product/1/");
xhr.send();









share|improve this question









New contributor




emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    4















    I try to make a basic progress bar with ajax , when I click button add to cart, but I don't know how catch the xhr on console,to put on alert() or prepend()function




    I follow a video example in youtube, with XMLHttpRequest() function but I see doesn't work




    see the code:



    var xhr = new XMLHttpRequest();

    xhr.upload.addEventListener('progress', ProgressHandler ,false);
    xhr.addEventListener('load', CompleteHandler,false);
    xhr.addEventListener('error', errorHandler,false);
    xhr.addEventListener('abort',LoadHandler,false);


    xhr.open("POST","/test/checkout/cart/add/uenc/aHR0cDovLzQ1Ljc5LjE0Ni4yMS90ZXN0L3Rlc3RpbmcuaHRtbA%2C%2C/product/1/");
    xhr.send();









    share|improve this question









    New contributor




    emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      4












      4








      4








      I try to make a basic progress bar with ajax , when I click button add to cart, but I don't know how catch the xhr on console,to put on alert() or prepend()function




      I follow a video example in youtube, with XMLHttpRequest() function but I see doesn't work




      see the code:



      var xhr = new XMLHttpRequest();

      xhr.upload.addEventListener('progress', ProgressHandler ,false);
      xhr.addEventListener('load', CompleteHandler,false);
      xhr.addEventListener('error', errorHandler,false);
      xhr.addEventListener('abort',LoadHandler,false);


      xhr.open("POST","/test/checkout/cart/add/uenc/aHR0cDovLzQ1Ljc5LjE0Ni4yMS90ZXN0L3Rlc3RpbmcuaHRtbA%2C%2C/product/1/");
      xhr.send();









      share|improve this question









      New contributor




      emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I try to make a basic progress bar with ajax , when I click button add to cart, but I don't know how catch the xhr on console,to put on alert() or prepend()function




      I follow a video example in youtube, with XMLHttpRequest() function but I see doesn't work




      see the code:



      var xhr = new XMLHttpRequest();

      xhr.upload.addEventListener('progress', ProgressHandler ,false);
      xhr.addEventListener('load', CompleteHandler,false);
      xhr.addEventListener('error', errorHandler,false);
      xhr.addEventListener('abort',LoadHandler,false);


      xhr.open("POST","/test/checkout/cart/add/uenc/aHR0cDovLzQ1Ljc5LjE0Ni4yMS90ZXN0L3Rlc3RpbmcuaHRtbA%2C%2C/product/1/");
      xhr.send();






      magento2 javascript ajax jquery






      share|improve this question









      New contributor




      emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 2 mins ago









      magefms

      1,427224




      1,427224






      New contributor




      emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 9 hours ago









      emmanuel ortegaemmanuel ortega

      211




      211




      New contributor




      emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      emmanuel ortega is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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
          });


          }
          });






          emmanuel ortega is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f265568%2fhow-to-create-a-basic-progress-bar-with-ajax-when-i-click-add-to-cart-in-magent%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          emmanuel ortega is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          emmanuel ortega is a new contributor. Be nice, and check out our Code of Conduct.













          emmanuel ortega is a new contributor. Be nice, and check out our Code of Conduct.












          emmanuel ortega is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Magento Stack Exchange!


          • 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%2fmagento.stackexchange.com%2fquestions%2f265568%2fhow-to-create-a-basic-progress-bar-with-ajax-when-i-click-add-to-cart-in-magent%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

          “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

          How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

          夢乃愛華...