Ciao.
Come ottenere una referenza alla li cliccata?
Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
</style>
<script type="text/javascript" src="jquery/jquery-1.2.2.js"></script>
<script type="text/javascript">
$(document).ready( function () {
$(".employeeNames").click( function () {
$.ajax({
type: "GET",
url: "employee_details.php",
data: "id="+$(this).attr('id'),
success: function(msg){
//come ottenere una reference al li cliccato
$(this).children("div").text(msg);
//non funziona :(
}
});
});
});
</script>
</head>
<body>
<ul>
<li class="employeeNames" id="48"><div></div>yasin1
<li class="employeeNames" id="47"><div></div>provapop3
<li class="employeeNames" id="46"><div></div>yasin[/list]
</body>
</html>
PS
Mah Jquery sarà utile ma PP bisogna rimparare js
quasi