I've got a js function using jquery that works fine with 1.8.3.js, but when I update to 1.9.1.js it quits. I really don't know anything about jquery at this point (it's on the list of things to study, coming up soon), so I really can't tell from looking at it where the problem might come in. Here is the code:
<script type="text/javascript">
var allCheckBoxSelector = '#<%=GridView1.ClientID%>
input[id*="chkAll"]:checkbox';
var checkBoxSelector = '#<%=GridView1.ClientID%>
input[id*="chkSelected"]:checkbox';
function ToggleCheckUncheckAllOptionAsNeeded()
{
var totalCheckboxes = $(checkBoxSelector),
checkedCheckboxes = totalCheckboxes.filter(":checked"),
noCheckboxesAreChecked = (checkedCheckboxes.length === 0),
allCheckboxesAreChecked = (totalCheckboxes.length ===
checkedCheckboxes.length);
$(allCheckBoxSelector).prop('checked', allCheckboxesAreChecked);
}
$(document).ready(function ()
{
$(allCheckBoxSelector).live('click', function ()
{
$(checkBoxSelector).prop('checked', $(this).is(':checked'));
ToggleCheckUncheckAllOptionAsNeeded();
});
$(checkBoxSelector).live('click', ToggleCheckUncheckAllOptionAsNeeded);
ToggleCheckUncheckAllOptionAsNeeded();
});
</script>
Any suggestions on what the problem is here? Again, when referencing 1.8.3.js, it works perfectly, but when using 1.9.1.js checking the "check all" box doesn't have any effect.