Coder Social home page Coder Social logo

jq-ajax-progress's Introduction

jq-ajax-progress's People

Contributors

likerrr avatar mnaughto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jq-ajax-progress's Issues

Browserify support?

Hi, sorry if this is the wrong forum for this - but how do you use this with browserify?

I've tried just require()-ing the module right after my jQuery is loaded, but it doesn't add the methods to promises created through $.ajax()

var $	 = require('jquery');
window.$ = window.jQuery = $;
require('jq-ajax-progress');

Then I set up the $.ajax as usual:

var promise = $.ajax({
    url: getApiUri(),
    type: 'POST',
    ...
});

But then promise.uploadProgress is not a function when I want to pass a function to it. Indeed if I inspect the promise, it has no function called uploadProgress. But I can see that the code is ran where it replaces the "old" $.ajax.

ajax options are mutated and cause safari to return the old headers when retrying the request with the same options

Hi guys,

First of all thanks for your work on this plugin. I'm facing issues due to the mutation that are being done inside this library. Specifically in Mac OS Safari (15) it causes the first request to return the old headers from the initial request. I checked and it's due to how we are mutating the options to have this new function that relies on a preinitialized xmlHttpReq variable:
options.xhr = function () {

so what I'm doing is something like this:

const requestParams = {url:....};
const jqXHR = $.ajax(requestParams);
return Promise.resolve(jqXHR)
		.catch(() => {
			if (shouldRetry) {
				return $.ajax(requestParams); //Due to the mutation this will end up returning an object with the wrong headers because it is reusing the same xmlHttpReq variable of the first call and safari doesn't clean those up.
			});

From my end I could avoid this by doing a clone of the requestParams, but I reckon we should be mutating this object for the user.

[Android - Firefox] uploadProgress() callback not fired ..

Hi.
I have been using your plugin on my latest projects, and it always worked fine ...
well... almost always :S

I never had problems on most common desktop browsers.
Also on Chrome (x Android) seems to work fine.

But i just discovered that, on Firefox (x Android), the uploadProgress() callback is NEVER executed!

I hope this project is still mantained and issues checked ;))
Anyway, thanks for your job!

.progress not working

console.log("start");

var rand = '&rand='+Math.round(new Date().getTime() / 1000);
var component_url = jQuery('#component_url').val();

jQuery.ajax(component_url+'&task=install.downloadWgiz'+rand).progress(function(e) {
    console.log("progress");
    console.log(e);
}).uploadProgress(function(e) {
    // tracking uploading
    // if (e.lengthComputable) {
    //  var percentage = Math.round((e.loaded * 100) / e.total);
    //  console.log(percentage);
});

console.log("end");

Thats's my code. Vars "rand" and "component_url" are working as expected. The ajax is getting called normally but i'm unable to see those two console logs inside the ".progress" function.

"console.log('start');" and "console.log('end');" are working as well.

Why?

Chrome jumps to 100% instantly

Hi,

Thanks for the plugin. Noticing chrome jumps to 100% instantly when trying to upload a base64 video/image. Does this need to be converted back to a BLOB in order for the progress callback to behave as expected?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.