[jQuery] ajax related question

[jQuery] ajax related question

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16441" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2>hello!</FONT></SPAN></DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial size=2>i'm developing a
website where a div gets updated via an ajax call: that new content contains
Anchor elements with a class="tag"</FONT></SPAN></DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial size=2>Now, i have a
specific behavior planned for these a.class elements, but it does not happen.
Even having just an alert() does not work.</FONT></SPAN></DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial size=2>i think this is due
to the fact taht when $(document).ready() is performed, these a.tag do not exist
yet, so the behaviour is not attached to them.</FONT></SPAN></DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial size=2>Is there a solution
to this? i tried returning the javascript behaviour along with the ajax output,
but that doesn't work.</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial size=2>here is the sample
behaviour:</FONT></SPAN></DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2> $("a.tag").bind("click", function(){<BR>  
alert("hi");<BR>   return false;<BR> });</FONT></SPAN></DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial size=2>thank you for your
advises !</FONT></SPAN></DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968373814-08062007><FONT face=Arial
size=2>Alex</FONT></SPAN></DIV></BODY></HTML>
<BR>
<P><FONT SIZE=2>Ce message Envoi est certifié sans virus connu.<BR>
Analyse effectuée par AVG.<BR>
Version: 7.5.472 / Base de données virus: 269.8.11/838 - Date: 7/06/2007 14:21<BR>
</FONT> </P>