任何人都可以帮忙吗?我在更新“table”中的“div”以更新“tr with_id”时遇到问题。但是,当我运行测试并在表之外放置 without_"id" 时,我的脚本运行得很好,我得到了服务器 "TEST" 响应
<table style="border: none; border-bottom: 1px solid #2F2E2F;">
<tr>
<th colspan="4">Notifications</th>
</tr>
<div id="update_118">
<tr class="read_118">
</div>
<td>... </td>
<td><a href="http://www.hamayk.com/photos/show/156"> Comment on your Photo </a></td>
<td>today 21:43</td>
<td>... </td>
</tr>
</table>
现在我想在鼠标悬停成功时更新这个“div”:function() without page refresh to have its value change to class="light" to have NOT TO CALL ajax url: "/alerts/ajax_read/118" over and鼠标在它上面时结束。
<div id="update_118">
<tr class="light">
</div>
这是我的脚本,...
<script>
$(document).ready(function(){
$('.read_118').on('mouseover', function(){
var id = $(this).attr("id")
var data = 'id=' + id ;
$.ajax({
type: "GET",
url: "/alerts/ajax_read/118",
data: data,
cache: false,
success: function(){
$('#update_118').fadeOut('slow').load('/alerts/ajax_load/118').fadeIn("slow");
return false;
}
});
});
});
</script>
这是我的服务器响应文件:
$response = " <tr class='light'> ";
echo $response;
提前谢谢,...克里斯