[FIXED] bind ajax call to click event

[FIXED] bind ajax call to click event

Hi,

I came to post my question here because i'm desperate.

My problem is that I need to track the slide (Up/Down) of a panel.

The panel has <span> row on it, if you click on it slides up/down.

here is my code:

$("body").delegate('span[id^="iconReplie_"][class="openPanel"]', 'click' , function() {
      var id = $(this).prop('id');
      id = id.replace('iconReplie_','');
      console.log('click on iconReplie');
      $.ajax({
            type : "GET",
            url : getContextAppli()+ "tracePlanningOperations?" +                               jQuery.param({sessionApplicative:$("input[name='sessionApplicative']").val()}) +                                                 "&idOperation=" + id});
});

When i put it in my web browser console, it runs fine even if i just want the "openPanel" action but it is not a big problem, But when i
put it in my jsp it just don't work. I have a datepicker in my page and when i click on a date it shows me the corresponding panels (closed by default).

Any idea why it doesnt work?

My idea is that when the instruction is executed, the panels aren't visible yet but I'm not sure.

Thanks in advance.