Hiya,

You just need to rebind your click events after the new data has been added
- this will attach it to the new rows (if I understand what you're trying to
do correctly).

You shouldn't ever really call $(document).ready - you'll get in a right
pickle :) Put in a function called attachEvents or something and then put
your .click function assignment in there... then re-call it when the dom is
modified.

On 03/12/06, enquest <[EMAIL PROTECTED]> wrote:

I got the following problem. With some diffuclties to explain.

this is what it does.
1. in a table td you can click.
2. action: jquery look ID up in an array
3. .append the whole bunch of information in the page
4. This new information fadeIn.
5. This new data also has some buttons where jquery should respond on.

Problem: jquery does not respond on the new .appended information. My
guess is that the DOM and jquery does not yet know about this new data.
So I need to do something to make sure that the dom is reloaded or
something. What should I do, how to write that syntax? a.edit won't work
cause that would be on the new layout.


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;
        });


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




--
Tom Holder

Managing Director
Atom Software Ltd
t: 01722 770001
f: 0117 923 9922
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to