views:

116

answers:

1

This question is related to my last one about jQuery 1.4. They supposedly fixed the bug causing the change handlers not to work in IE, but it is not fully fixed.

I am trying to bind a live change handler to a select element. Most of the time, when I change it, the event handler fires. But if I tab to the element immediately after the page loads, then try to change the value using the keyboard, then tab away from it, the event doesn't fire in IE. This only happens the first time I try to change the value. I noticed this in IE 6, 7, and 8. It does not happen in any other browsers I tried. I am sure it is a bug in jQuery. Does anyone know a simple way around this?

Here is an example page to demonstrate the bug:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
<html><head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<title>jQuery live change handler test 2</title>
</head>
<body>
<script type="text/javascript" src="jquery-1.4.1.min.js"></script>
<select id="test">
    <option value="a">a
    <option value="b">b
</select>
<script type="text/javascript">
$("#test").live("change", function() {
    alert('hi');
});
</script>
</body></html>
+2  A: 

For jQuery 1.4 the fix is here: http://github.com/jquery/jquery/commit/435772e29b4ac4ccfdefbc4045d43f714e153381

For jQuery 1.4.1 the fix is here: http://github.com/jquery/jquery/commit/942f8f7f75a55a36e6b9745030d3b3c983518aa8

Here is the bug discussion: http://dev.jquery.com/ticket/5851

mr.moses
Thank you. It is nice to know that they acknowledged these bugs and it appears like they are doing something about it.
mikez302
In the bug discussion, I see a mention of a jQuery 1.4.2 milestone. Does anyone have any hint as to when jQuery 1.4.2 will be released?
mikez302