I have a webpage using jquery 1.42
The following 2 segments of code live in my page.
$('body').delegate('h2', 'click', function() {
$(this).after("<p>delegate paragraph!<\/p>");
});
$('body h2').live('click', function() {
$(this).after("<p>live paragraph!<\/p>");
});
The live method always works, yet the delegate doesn't fire at all.
If I create a trivial page with simple html
<body><h2>blah</h2></body>
both approaches work. So I'm assuming there is something else going on in my page.
With firebug I am seeing no javascript errors, no html errors. and breakpoints on the delegate method definately do not get hit.
What else might be the cause of delegate not triggering?
EDIT: heres the list of other scripts on the page:
<script type="text/javascript" src="/Scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/Scripts/2010.1.416/telerik.common.min.js"> </script>
<script type="text/javascript" src="/Scripts/2010.1.416/telerik.textbox.min.js"></script>
<script type="text/javascript" src="/Scripts/2010.1.416/telerik.grid.js"></script>
<script type="text/javascript" src="/Scripts/2010.1.416/telerik.grid.filtering.min.js"></script>
<script type="text/javascript" src="/Scripts/2010.1.416/jquery.validate.min.js"></script>
<script type="text/javascript" src="/Scripts/2010.1.416/telerik.grid.editing.min.js"></script>