Enquest wrote:
> 
> 
> Code example:
> $("td.info").click(function(){
>       var id = this.id;
>       $("div#info").hide("medium", function(){
>       $("div#info").empty();
>       $("div#info").append(customer_data[id]);
>       $("div#info").show("medium");
>       $(document).ready; // don't know how to do this part
>       });
> 
> $("a.edit").click(function(){
>       alert("test");
>       return false;
>       });
> 

I think you want something like this. I am thinking that the a.edit is
inside div#info? You should unbind event handlers before empty() to prevent
memory leaks in IE.Then you can attach the new event handler after you
insert the new content.

$("td.info").click(function(){
  var id = this.id;
  $("#info").hide("medium", function(){
    $(this)
      .find("a.edit").unbind("click").end()
      .empty().append(customer_data[id])
      .find("a.edit").bind("click", function(){
        alert("test");
        return false;
      }).end()
      .show("medium");
  });
});

-- 
View this message in context: 
http://www.nabble.com/%24%28document%29.ready%28%29-.append-tf2747742.html#a7670109
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to