On Mon, Nov 9, 2009 at 3:26 PM, factoringcompare.com < firstfacto...@googlemail.com> wrote:
> When <div id="MyResult"></div> changes with a AJAX response I would > like to fire a alert. What am I doing wrong? > > $(document).ready(function() { > > $("#MyResult").change(function (){ > alert('hi'); > }); > > }); > I think the change event only applies to <select> and <input> elements. Most AJAX methods let you specify some sort of callback function to execute. See http://docs.jquery.com/Ajax/ajaxComplete#callback or http://docs.jquery.com/Ajax/load#urldatacallback or http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback or (well, you get the point). Point being... you should be able to fire your alert as part of the callback function :) -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.