views:

34

answers:

1

I have the Problem, when i use AJAX for a part of my page like a commentbox, that in the reloaded box no javascript works like cutetime or whatever. So i guess i have to reload the cutetime command (in every reload of the commentbox)

it works, but i think i have the cutetime command twice, because if i have a confirm box or anything other i got the confirm box or the add command twice.

I try to describe it in one scentence:
I need a way to get Javascript woking in a reloaded AJAX-Box.

PS.: i think there is a very easy way cause everybody use it :)

+1  A: 

If you replace an element anything attached to it is lost.

When using jQuery, you can avoid this issue by using live events. However, this doesn't work for plugins where you don't attach events. In that case you need to call whatever function enables something on your element again when replacing it.

ThiefMaster
Yes i use JQuery. I'm not a pro in it but i try it :)So i even use "$(document).ready(function(){ }" for everything but sould i use onclick of whatever ?
m0