Giter Site home page Giter Site logo

ajaxq's People

Contributors

bgrins avatar d4nirod avatar fredericdelaporte avatar jagandecapri avatar kulbakin avatar lyudmil avatar miljan-aleksic avatar philetaylor avatar thedustinsmith 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ajaxq's Issues

Problem In Queue

Hi,
I m using this plugin, but my ajax requests are as usually getting cancelled.
image

Thanks in Advance.

Have next request triggered by callback from previous request

There may be an easy way to do this without using timers: I want to block the next request in the queue until the previous request's callback function has finished executing. The only way I can envision this is to block the queue on the previous request, and unblock it by having the callback call an unblockQueue() [doNextRequest()?] method on ajaxq.

Clear seems not to cancel active requests

the clear function seems not to cancel any active requests and also seems to allow following calls in the queue to continue.

Have you come across this issue yourself?

Demo structure cleanup

The current structure is done in a way that we can just straight merge master to gh-pages branch and it will work. I think it would be better to just have a demo folder with all the files we need for gh-pages and publish just that folder to the gh-pages branch (see https://gist.github.com/cobyism/4730490).

Basically all this entails is moving the index.html to the demo folder and creating a deployment script for gh-pages, but there will be few smaller changes that will need to be made to accomplish this, so I'm creating an issue for now.

Feature request - giving delays

Thank you for great script. That's cool.

It would be helpful if we can give predefined second delays between each AJAX request.
That will give more human-like behaviour to our requests :)

Cross Origin Request issue while using AjaxQ

`

  <script src="js/lib/jquery-3.2.1.min.js"></script>	
  <script src="js/lib/jquery.ajaxq.min.js"></script>		  
	<script>
		var root = 'https://jsonplaceholder.typicode.com';

		$.ajaxq('Queue1',{
			url: root + '/posts/1',
			method: 'GET',
			success: function(data) {
				console.log(data);
			}
		});			
	</script>
`

Please help me with the above code. Where am I going wrong? The error message is:

Failed to load file:///C:/Users/ranbirs/Desktop/Kendo%20RequireJS%20-%20Copy/Queue1: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

error

Feature request - cancel queue

Sorry for bad English.
I didn't find appropriate place to post this message. That's why it here.
Is there a way to implement feature such as cancel queue? It will be very useful.

I tried implement it myself moreover it working for me. But 1. it cancel all queues, 2. I think i've made it not so correct :) (without full knowledge of Deferred object)

Thanks

Bower config

bower ajaxq#* mismatch Version declared in the json (0.0.6) is different than the resolved one (0.0.7)

ajaxPrefilter error

Hey,

I want include default data in ajax request, but when i try this code :

` $.ajaxPrefilter(function (options, originalOptions) {

    options.data = $.extend(originalOptions.data, { r: "revision" });

}); `

I have found this code at :
https://stackoverflow.com/questions/6996993/jquerys-ajaxsetup-i-would-like-to-add-default-data-for-get-requests-only

It's not work, and i have this error :
Uncaught TypeError: o.data.replace is not a function
at ajax (jquery-3.2.1.min.js:4)
at ajaxq.js:30
at enqueue (ajaxq.js:53)
at Function.$.ajaxq (ajaxq.js:28)

How use ajax filter with ajaxq ?

Tanks for help !
Have nice day !

Misleading Error text

There is an error on line 27:

if (typeof opts === "undefined") {
      throw ("AjaxQ: queue name is not provided");
}

I think it should say: "AjaxQ: no options provided" or something like that. because you're not testing for qname.

Unit testing

Hello again,

I felt a bit uncomfortable not having unit tests for my modifications to AjaxQ, so I set up a Jasmine standalone test runner and added tests for the code I wrote. Is this something that you'd be interested in having on the main branch? I so, I could complete the test suite, adding tests for the core functions ($.ajaxq, $.getq, $.postq) and send a pull request.

Thanks again for releasing this, it has really helped.

Bug with clear

ajaxq.clear method is meant to clear active queue without aborting current request. Having that in mind, i would expect subsequent ajax requests added to the queue to be executed after running request is complete, not immediately. here is test case

$.ajaxq('queue', ajax1); // runs right away
$.ajaxq('queue', ajax2); // queues after ajax1
$.ajaxq.clear('queue'); // removes ajax2 from queue but keeps ajax1 running
$.ajaxq('queue', ajax3); // queued after ajax1 is expected, but currently runs right away even if ajax1 is not complete

Feature request - callback/promise interface on the queue itself

I would like to request the ability to specify a callback/promise resolve function for the following events :

  • a queue completes all its requests > queue done
  • one of the requests failed > queue fail

and on the side note, it would be great to make the auto-send of requests an option, allowing to add some number of requests to a queue, and then "start" the queue at a later point.

isRunning always returns true in success function

The isRunning methods checks to see if the queue exists which it always does in the ajax success function because the request isn't removed from the queue until the dequeue function is called AFTER all the deferred done/fail functions are applied (as explicitly defined on line 41) - which is in complete contrast to the example provided in the documentation.

Dont work in YM module

If I run ajaxq in YM module (https://github.com/ymaps/modules), it runs once and then no ajax requests sends.

`
modules.define('main-tovar-tile',function(provide, prevC) {

provide({
	init: function(){
		var _this = this;
		$("body").on("click",".main-tovar-tile__later-link",function(){

			var i =$(this).find("i");
			var id = 0;
			if(i.hasClass("fa-heart")){
				i.removeClass("fa-heart").addClass("fa-heart-o");
			}
			else{
				i.removeClass("fa-heart-o").addClass("fa-heart");
				
				id = $(this).data("id");

				_this.send_to_wishes(id);
			}
		});
	},
	send_to_wishes: function(id){
		
		$.ajaxq("atb",{
			type : "post",
			dataType : "json",
			url : "/wp/wp-admin/admin-ajax.php?action=to_wishes",
			data : {id:id},
			success: function(response) {

				if(response.success == true) {
					
					$(window).trigger("add_to_wishes",{count:response.data.count});
					alert(response.data.count);
				}



			}

		});
	}
});

});
modules.require("main-tovar-tile",function(provide){
provide.init();
});

`

$.ajaxq in IE9

For most of the browsers ajaxQ works well.
But it seems like IE9 doesn't support `$.ajaxq`` syntax.
Did you try ajaxQ in IE9 ?
I get this error frequently in IE 9, sometimes IE10 also gives error.
Chrome, Firefox works well.

(I use jquery 1.9.1)

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.