Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个常规日历,其中 td 有一个点击事件处理程序。我返回表格单元格(1-31)的值。我也有一个事件列表 - 每天只有 1 个
<div class="event"> <h2>the title</h2> <div class="date"> October <span class="day">23</span> 2012 </div> </div>
我需要做的是当我点击日历上的日期时过滤掉事件。
您可以使用ajax
ajax
$(document).ready(function(){ $(".day").on("click",function(){ $.get("getevents.php?day="+$(this).text(),function(data){ $("#showing div").html(data); //or $(".event").find("h2").text(data); }) }) })