[jQuery] Re: How to check whether an element is bound to an event or not?

2010-01-02 Thread Joe Sondow
Yes, the live function. http://docs.jquery.com/Events/live

Added in jQuery 1.3: Binds a handler to an event (like click) for all
current - and future - matched element. Can also bind custom events.

On Jan 2, 11:44 pm, Md. Ali Ahsan Rana ranacser...@gmail.com
wrote:
 hi, thanks. But, what is happening here is:
      There is an DOM element, which is reloading(replaced by ajax response
 with same id/tag), then the event isn't no more bounded. I want it to be
 bounded all the time.  Do you think, here unbound will work? Or Is there any
 way to keep the binding whenever a new element is being loaded?

 Regards

 On Sun, Jan 3, 2010 at 1:41 AM, waseem sabjee waseemsab...@gmail.comwrote:



  usually when I bind a click event I do this.
  unbind before bind

  $(elm).unbind('click');
  $(elm).bind(click, function() {

  });

  may be a modification like this

  if(!$(elm).unbind('click')) {
     $(elm).bind(click, function() {
       alert(This element was only bound if it was not bound);
     });
  }

  On Sat, Jan 2, 2010 at 7:28 PM, ranacseruet ranacser...@gmail.com wrote:

  I need to check whether an element is bound to an event or not. How to
  achieve this?

 --http://ranacseruet.blogspot.com/


[jQuery] Re: json return

2009-12-30 Thread Joe Sondow
Your json string represents an array. The variable data is probably
that array. There is no idfakultas property on the array, but there is
an idfakultas property on each of the two objects in the array. Try
this for your alert:

alert(tes = + data[0].idfakultas +   + data[1].idfakultas);