[jQuery] created $.xmlActive and AJAX loading indicator + more

[jQuery] created $.xmlActive and AJAX loading indicator + more

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
As i also mailed to John yesterday i have started to work on the ajax
part of jQuery.
I have added a few (just a few hehe) things which i want to share with
you guys:
<b>Notes:</b>
- For debugging purposes this is the SANE version, because i want you
all to see what i changed.
- This <b>shouldn't</b> be used in a
production environment.
- Some elements of the ajax file where removed/replaced with my own
code.
- E.g. "$.fn.handleAJAX" is gone cause i have no longer a need for
it.
- "Dynamic Form Submission" is also removed as i created my own
serialize function for it.
----------
----------
----------
----------
----------
<b>$.xml</b>
I added two request headers and code to keep track of the number of
active query's. One of the two request headers allows the calling page
to see that it's an ajax call, and the other one fixes a mozilla bug
(taken from Prototype).
-----
<big><font size="-1"><big><b>$.xmlActive + xml Loading indicator:</b>
</big></font><font size="-1"><big>I added an xmlActive
counter. This holds the number of active xmlRequests. It's pretty
straightforward to use. If the $.xml function is called, the
$.xmlActive counter is increased and the function "$.xmlCreate" get's
called if it exists. I use this function to show the progress indicator
but you could really do anything you like. When the xml is finished,
the counter is decreased and if the counter reaches 0, the $.xmlDestroy
function is called. I use it to hide the loading indicator.</big></font>
</big>
Example:
$.xmlCreate = function() { $('#ajaxBusy').show(); }
$.xmlDestroy = function() { $('#ajaxBusy').fadeOut("normal"); }
-----
<b>$.fn.formValues:</b>
Gets the form values of a form in a key=>value method. Thus
replacing the "Dynamic Form Submission"-part. This is more flexible
since it only gets the form values. You decide what you want to do with
it. I use it together with my <b>$.update</b> function (read below)
Example:
$('#frmLogin').formValues();
-----
<b>$.update</b>:
Mimics the ajaxUpdater from prototype. Posts the key=>value array to
the url and puts the results from that call in the jQuery object
specified. If you set the blnNoEval to true, the script tags are NOT
evaluated.
Example:
$.update('someJQueryObject', 'someurl', 'key=>value array',
'boolean');
<div class="moz-signature">--
<font color="#000000" face="tahoma" size="2">Met vriendelijke groet,
Gilles van den Hoven
Webunity
Gen. de Carislaan 70
5623 GM Eindhoven
e: <a href="mailto:info@webunity.nl">info@webunity.nl</a>
t: 040 - 2692481
f: 040 - 7505892
m: 06 - 43055545
<font color="#999999" size="1">Alle genoemde prijzen zijn exclusief
btw. De informatie opgenomen in dit bericht kan vertrouwelijk zijn en
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht
onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de
afzender direct te informeren door het bericht te retourneren.</font>
</font></div>
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/