live events to a li elements with jquery
Hi. before all i'm not a english speaker. Please be patient with my language.
btw...
I have some kind of the following UL as a menu
-
<ul>
<li class="link" title="index.php"><a href="#">index</a></li>
<li class="link" title="main.php?option=1"><a href="#">main</a></li>
<li class="link" title="etc.php"><a href="#">etc</a></li>
</ul>
And im trying with jquery to make them load content (the php files) into a div by ajax
-
$(".link").each(function(){
var url = $(this).attr("title");
$(this).live("click", function(){ $.get(url, function(html){
$("#cuerpo").html("lalala");
})})
});
but it is not working... what im doing wrong?
thanks for any advice.