Hi,
I don't know exactly why this works, but I did some debugging and I've
figured out what exactly the datepicker does which prevents the leaks
in IE. And then I've put this magic into a separate *.js, so you can
use it without creating dummy controls and initializing dummy
datepickers.
So here is the thing:
/*
* jQuery AntiLeak for IE
*
* Copyright (c) 2009 Barcode Computers Ltd.
*
*/
(function($) { // hide the namespace
function AntiLeak() { }
$.preventLeaks = new AntiLeak();
$.extend(AntiLeak.prototype, {
_checkExternalClick: function(event) { }
});
$.fn.preventLeaks = function() {
$(document).mousedown($.preventLeaks._checkExternalClick).
find('body').append($.preventLeaks.dpDiv);
};
})(jQuery);
Now what you have to do is simply the following:
1. Copy-paste the above snippet into *.js, say, ie_antileak.js
2. Add it to your page using <script src='ie_antileak.js' type='text/
javascript'></script>
3. Activate it using
$(document).ready(function() {
$(this).preventLeaks();
});
That's all...
This code must be executed on every page, so you should consider
adding this thing to your master page or whatever it is called in the
platform you are developing with.
Of course, feel free to modify this module if you want to. And of
course, it can give you an idea why this leak happens. I can't say
exactly, because I am not familiar with jQuery architecture so
deeply... But it works =)
On Mar 18, 5:55 pm, Scott González <[email protected]> wrote:
> I don't understand why that helps at all, but I do know that the
> memory leaks are coming from using namespaced events. This is causing
> every jQuery UI plugin to leak memory. Seehttp://dev.jquery.com/ticket/4241
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---