5

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();
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.