Hi Jakob,

This is a good question that comes up quite a bit on this list. So I thought it might be a good idea to post a relevant excerpt of the forthcoming book, Learning jQuery, to the tutorial wiki:

http://docs.jquery.com/Tutorials:AJAX_and_Events

Jonathan Chaffer has already posted this to the list, so for those of you who have already read that, you won't find anything new here (except for a couple minor edits). It specifies AJAX, but the same principles apply with plain J DOM modification.

If you don't find the answer to your question in that article, let us know.

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On May 8, 2007, at 8:01 AM, [EMAIL PROTECTED] wrote:


Well, im trying to append childrens to a div in a administration tool
im developing. The problem is simple: I've added som html to this div
like this:

var toInsert =  '<div class="menuBoxContentRow event"
name="eventRowHere">'+
                '<div class="eventTitle">'+unescape($
(curEvent).find('Name').text())+'</div>' +
                '<div class="eventDetail">domain: '+unescape($
(curEvent).find('Domain').text())+'</div>' +
                '<div class="eventDetail">vinder fundet: '+winnerFound+'</div>' 
+
                '</div>';

$("#eventsMenuContent").append(toInsert);


And im trying to listen for onclick events on this with

$("[EMAIL PROTECTED]").click(
 function()
{
        alert('asdasd');
});

All this is done inside a  $(document).ready(function() {}); - But it
wont work?

Do I need to tell jQuery that something has been appended?

Thanks in advance.

Regards,
Jakob Dam Jensen


Reply via email to