I'm using these scripts (where jquery-ui[].custom.js is the datepicker plugin):
<script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.13.custom.js" type="text/javascript"></script>
<script id="formvalidation" type="text/javascript">
$(document).ready(function () {
$(".datepicker").datepicker({ dateFormat: 'dd/mm/yy' });
});
</script>
On this input element (inside a form):
<input type="text" name="Date" class="datepicker" />
The page loads fine and when I click in the input field the datepicker pops up correctly, but I get a memory leak (in every browser) once a date is selected and the datepicker disappears. This causes that bit of JS to crash or slow down the browser because of a memory leak in jquery-1.5.1.js:
Line: 1520 Error: Out of memory
When debugging I see the error line is at 2310
jQuery.event.remove( elem, type + types );
A little context:
// Unbind all events for the element
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
types = types || "";
for ( type in events ) {
jQuery.event.remove( elem, type + types );
}
return;
}
Am I doing something wrong or maybe its a bug in jquery? I'm also using the validation plugin but the same error occurs when I disable it.
[Solved?] Since I can't post my answer for 8 hours:
Solved the leak by switching to the minimal version of jquery (jquery-1.5.1.min.js & jquery-ui-1.8.13.custom.min.js). It appears there is some discrepancy between the min version and the dev version.
Side question: Where would be a good place to bring this up if its not already an issue?
Solved the leak by switching to the minimal version of jquery (jquery-1.5.1.min.js & jquery-ui-1.8.13.custom.min.js). It appears there is some discrepancy between the min version and the dev version.
Side question: Where would be a good place to bring this up if its not already an issue?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With