[jQuery] Re: [New Plugins] Ajax Queue and Ajax Sync

2007-08-08 Thread Ganeshji Marwaha
I didnt find much use for these right now, but i am sure, the day won't be
far when this will save my day...

I am more interested in a plugin (or in the core itself) that will allow me
to tell jquery what an error as it applies to ajax.
At present, i guess that it is hard-coded within, which is not much useful
for handling application specific errors. And i think the error handler is
the cleanest place to handle app specific errors.

Just so you know mootools has this feature.

-GTG

On 8/7/07, John Resig [EMAIL PROTECTED] wrote:


 In the source of the URL that I linked to. I also just added it to the
 main contents, to make it easier to access.

 --John

 On 8/7/07, Christopher Jordan [EMAIL PROTECTED] wrote:
  Those sound really useful! Where can we get the code?
 
  Cheers,
  Chris
 
 
  On 8/7/07, John Resig [EMAIL PROTECTED]  wrote:
  
   Hey everyone -
  
   So Mike Hostetler was telling me about some Ajax queueing plugins that
   he wanted to write - so I got some ideas, and less than an hour later
   - here are two new Ajax queueing plugins for you to enjoy!
  
   Lame demo:
   http://dev.jquery.com/~john/plugins/ajaxqueue/
  
   About the plugins:
  
   * Queued Ajax requests. A new Ajax request won't be started until the
   previous queued request has finished.
  
 Example:
   jQuery.ajaxQueue({
   url:  test.php,
   success: function(html){ jQuery(ul).append(html); }
   });
  
   * Synced Ajax requests. The Ajax request will happen as soon as you
   call this method, but the callbacks (success/error/complete) won't
   fire until all previous synced requests have been completed.
  
 Example:
   jQuery.ajaxSync({
   url: test.php,
   success: function(html){
   jQuery(ul).append(b+html+/b); }
   });
  
   Both have their uses, but ajaxSync, in particular, seems quite useful.
   Let me know what you think. If this code helps you out, let me know,
   and I'll throw it up somewhere.
  
   --John
  
 
 
 
  --
  http://cjordan.us



[jQuery] Re: [New Plugins] Ajax Queue and Ajax Sync

2007-08-08 Thread Klaus Hartl


John Resig wrote:

Hey everyone -

So Mike Hostetler was telling me about some Ajax queueing plugins that
he wanted to write - so I got some ideas, and less than an hour later
- here are two new Ajax queueing plugins for you to enjoy!

Lame demo:
http://dev.jquery.com/~john/plugins/ajaxqueue/

About the plugins:

* Queued Ajax requests. A new Ajax request won't be started until the
previous queued request has finished.

  Example:
jQuery.ajaxQueue({
url: test.php,
success: function(html){ jQuery(ul).append(html); }
});

* Synced Ajax requests. The Ajax request will happen as soon as you
call this method, but the callbacks (success/error/complete) won't
fire until all previous synced requests have been completed.

  Example:
jQuery.ajaxSync({
url: test.php,
success: function(html){
jQuery(ul).append(b+html+/b); }
});

Both have their uses, but ajaxSync, in particular, seems quite useful.
Let me know what you think. If this code helps you out, let me know,
and I'll throw it up somewhere.

--John


John,

I find both plugins very useful and will most probably use them.

Synced requests are very useful for updating several parts of a page 
simultanously but with still simple HTML loading, I will for sure need 
this soon.


Thank you John!

Can you throw them into the repository?


--Klaus


[jQuery] Re: [New Plugins] Ajax Queue and Ajax Sync

2007-08-08 Thread Mike Fern

On 8/8/07, John Resig [EMAIL PROTECTED] wrote:

 Hey everyone -

 So Mike Hostetler was telling me about some Ajax queueing plugins that
 he wanted to write - so I got some ideas, and less than an hour later
 - here are two new Ajax queueing plugins for you to enjoy!

 Lame demo:
 http://dev.jquery.com/~john/plugins/ajaxqueue/

 About the plugins:

 * Queued Ajax requests. A new Ajax request won't be started until the
 previous queued request has finished.

   Example:
 jQuery.ajaxQueue({
 url: test.php,
 success: function(html){ jQuery(ul).append(html); }
 });

 * Synced Ajax requests. The Ajax request will happen as soon as you
 call this method, but the callbacks (success/error/complete) won't
 fire until all previous synced requests have been completed.

   Example:
 jQuery.ajaxSync({
 url: test.php,
 success: function(html){
 jQuery(ul).append(b+html+/b); }
 });

 Both have their uses, but ajaxSync, in particular, seems quite useful.
 Let me know what you think. If this code helps you out, let me know,
 and I'll throw it up somewhere.

 --John


Hi John,
This surely will be useful. I've been looking for ajax queue
functionality for a while but you make it simple :D

A study case where the ajax queue will be very useful is if someone is
connected to the internet behind proxy which needs authentication. If
the proxy requires user to re-authenticate after a certain period of
idle time, without ajax request queue, a lot of authentication
windows will appear because each request needs its own proxy
authentication. With queue approach, only one window will appear and
it will wait until user properly authenticates himself.

Thanks for the great idea and the great plugin.

Regards,
Mike


[jQuery] Re: [New Plugins] Ajax Queue and Ajax Sync

2007-08-08 Thread Mike Alsup

Ganeshji,

I you want control over ajax error handling you can just redefine the
jQuery.httpSuccess function.  That fn simply returns a boolean.  It is
currently implemented as follows:

httpSuccess: function( r ) {
try {
return !r.status  location.protocol == file: ||
( r.status = 200  r.status  300 ) || r.status == 304 ||
jQuery.browser.safari  r.status == undefined;
} catch(e){}
return false;
}

Mike

On 8/8/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 I didnt find much use for these right now, but i am sure, the day won't be
 far when this will save my day...

 I am more interested in a plugin (or in the core itself) that will allow me
 to tell jquery what an error as it applies to ajax.
 At present, i guess that it is hard-coded within, which is not much useful
 for handling application specific errors. And i think the error handler is
 the cleanest place to handle app specific errors.

 Just so you know mootools has this feature.

 -GTG


 On 8/7/07, John Resig [EMAIL PROTECTED] wrote:
 
  In the source of the URL that I linked to. I also just added it to the
  main contents, to make it easier to access.
 
  --John
 
  On 8/7/07, Christopher Jordan [EMAIL PROTECTED] wrote:
   Those sound really useful! Where can we get the code?
  
   Cheers,
   Chris
  
  
   On 8/7/07, John Resig [EMAIL PROTECTED]  wrote:
   
Hey everyone -
   
So Mike Hostetler was telling me about some Ajax queueing plugins that
he wanted to write - so I got some ideas, and less than an hour later
- here are two new Ajax queueing plugins for you to enjoy!
   
Lame demo:
http://dev.jquery.com/~john/plugins/ajaxqueue/
   
About the plugins:
   
* Queued Ajax requests. A new Ajax request won't be started until the
previous queued request has finished.
   
  Example:
jQuery.ajaxQueue({
url:  test.php,
success: function(html){ jQuery(ul).append(html); }
});
   
* Synced Ajax requests. The Ajax request will happen as soon as you
call this method, but the callbacks (success/error/complete) won't
fire until all previous synced requests have been completed.
   
  Example:
jQuery.ajaxSync({
url: test.php,
success: function(html){
jQuery(ul).append(b+html+/b); }
});
   
Both have their uses, but ajaxSync, in particular, seems quite useful.
Let me know what you think. If this code helps you out, let me know,
and I'll throw it up somewhere.
   
--John
   
  
  
  
   --
   http://cjordan.us
 




[jQuery] Re: [New Plugins] Ajax Queue and Ajax Sync

2007-08-08 Thread Ganeshji Marwaha
wow, thanks mike... that was really helpful... i will try that.

John, ignore my feature request ;-)

-GTG

On 8/8/07, Mike Alsup [EMAIL PROTECTED] wrote:


 Ganeshji,

 I you want control over ajax error handling you can just redefine the
 jQuery.httpSuccess function.  That fn simply returns a boolean.  It is
 currently implemented as follows:

 httpSuccess: function( r ) {
 try {
 return !r.status  location.protocol == file: ||
 ( r.status = 200  r.status  300 ) || r.status == 304 ||
 jQuery.browser.safari  r.status == undefined;
 } catch(e){}
 return false;
 }

 Mike

 On 8/8/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
  I didnt find much use for these right now, but i am sure, the day won't
 be
  far when this will save my day...
 
  I am more interested in a plugin (or in the core itself) that will allow
 me
  to tell jquery what an error as it applies to ajax.
  At present, i guess that it is hard-coded within, which is not much
 useful
  for handling application specific errors. And i think the error handler
 is
  the cleanest place to handle app specific errors.
 
  Just so you know mootools has this feature.
 
  -GTG
 
 
  On 8/7/07, John Resig [EMAIL PROTECTED] wrote:
  
   In the source of the URL that I linked to. I also just added it to the
   main contents, to make it easier to access.
  
   --John
  
   On 8/7/07, Christopher Jordan [EMAIL PROTECTED] wrote:
Those sound really useful! Where can we get the code?
   
Cheers,
Chris
   
   
On 8/7/07, John Resig [EMAIL PROTECTED]  wrote:

 Hey everyone -

 So Mike Hostetler was telling me about some Ajax queueing plugins
 that
 he wanted to write - so I got some ideas, and less than an hour
 later
 - here are two new Ajax queueing plugins for you to enjoy!

 Lame demo:
 http://dev.jquery.com/~john/plugins/ajaxqueue/

 About the plugins:

 * Queued Ajax requests. A new Ajax request won't be started until
 the
 previous queued request has finished.

   Example:
 jQuery.ajaxQueue({
 url:  test.php,
 success: function(html){
 jQuery(ul).append(html); }
 });

 * Synced Ajax requests. The Ajax request will happen as soon as
 you
 call this method, but the callbacks (success/error/complete) won't
 fire until all previous synced requests have been completed.

   Example:
 jQuery.ajaxSync({
 url: test.php,
 success: function(html){
 jQuery(ul).append(b+html+/b); }
 });

 Both have their uses, but ajaxSync, in particular, seems quite
 useful.
 Let me know what you think. If this code helps you out, let me
 know,
 and I'll throw it up somewhere.

 --John

   
   
   
--
http://cjordan.us
  
 
 



[jQuery] Re: [New Plugins] Ajax Queue and Ajax Sync

2007-08-07 Thread Christopher Jordan
Those sound really useful! Where can we get the code?

Cheers,
Chris

On 8/7/07, John Resig [EMAIL PROTECTED] wrote:


 Hey everyone -

 So Mike Hostetler was telling me about some Ajax queueing plugins that
 he wanted to write - so I got some ideas, and less than an hour later
 - here are two new Ajax queueing plugins for you to enjoy!

 Lame demo:
 http://dev.jquery.com/~john/plugins/ajaxqueue/

 About the plugins:

 * Queued Ajax requests. A new Ajax request won't be started until the
 previous queued request has finished.

   Example:
 jQuery.ajaxQueue({
 url: test.php,
 success: function(html){ jQuery(ul).append(html); }
 });

 * Synced Ajax requests. The Ajax request will happen as soon as you
 call this method, but the callbacks (success/error/complete) won't
 fire until all previous synced requests have been completed.

   Example:
 jQuery.ajaxSync({
 url: test.php,
 success: function(html){
 jQuery(ul).append(b+html+/b); }
 });

 Both have their uses, but ajaxSync, in particular, seems quite useful.
 Let me know what you think. If this code helps you out, let me know,
 and I'll throw it up somewhere.

 --John




-- 
http://cjordan.us


[jQuery] Re: [New Plugins] Ajax Queue and Ajax Sync

2007-08-07 Thread John Resig

In the source of the URL that I linked to. I also just added it to the
main contents, to make it easier to access.

--John

On 8/7/07, Christopher Jordan [EMAIL PROTECTED] wrote:
 Those sound really useful! Where can we get the code?

 Cheers,
 Chris


 On 8/7/07, John Resig [EMAIL PROTECTED]  wrote:
 
  Hey everyone -
 
  So Mike Hostetler was telling me about some Ajax queueing plugins that
  he wanted to write - so I got some ideas, and less than an hour later
  - here are two new Ajax queueing plugins for you to enjoy!
 
  Lame demo:
  http://dev.jquery.com/~john/plugins/ajaxqueue/
 
  About the plugins:
 
  * Queued Ajax requests. A new Ajax request won't be started until the
  previous queued request has finished.
 
Example:
  jQuery.ajaxQueue({
  url:  test.php,
  success: function(html){ jQuery(ul).append(html); }
  });
 
  * Synced Ajax requests. The Ajax request will happen as soon as you
  call this method, but the callbacks (success/error/complete) won't
  fire until all previous synced requests have been completed.
 
Example:
  jQuery.ajaxSync({
  url: test.php,
  success: function(html){
  jQuery(ul).append(b+html+/b); }
  });
 
  Both have their uses, but ajaxSync, in particular, seems quite useful.
  Let me know what you think. If this code helps you out, let me know,
  and I'll throw it up somewhere.
 
  --John
 



 --
 http://cjordan.us