Quick Ques...

Quick Ques...


The .live() technique is useful, but due to its special approach cannot be simply substituted for .bind() in all cases. Specific differences include:

      [...]
  • To stop further handlers from executing after one bound using .live(), the handler must return false. Calling .stopPropagation() will not accomplish this.
What does this actually mean? A click event bound to the same element wouldn't work if return false is set in the live code? I'm using .live() and it doesn't make any difference and there are other events registered as I have a plug-in attached to the same input as I'm monitoring change on! Just wondered.

  1. $('#startTime', ('.timeEntry_wrap')).live('change', function() {
  2.     var myHour = Jobs.cloneTime('hour', $('#startTime'));
  3.     $('#startHr').val(myHour);
  4.     var myInc = Jobs.cloneTime('inc', $('#startTime'));
  5.     $('#startMin').val(myInc);
  6.     return false;
  7. });
   



    • Topic Participants

    • sam