1

我的页面中有一个链接,我在它的onclick()事件中写了一个 div,其中包含一个名为“datepicker0”的日期输入文本,并且我在这个输入文本下方有一个 div id =“bContent”。

现在我写了下面的脚本,我想在“bContent”中对我的数据应用日期过滤器,但它不起作用!感谢任何帮助,请...

$('#datepicker0').live('focus', function() {
    $(this).datepicker().datepicker('show');
    true;
 })
 $('#datepicker0').live('change', function() {
    ShowMathesByDateFilter($(this).val());
 })

ShowMathesByDateFilter()功能是:

function ShowMathesByDateFilter(Fdate)
{

  if (Fdate=="")
  {
  $("#bContent").html('<div class="bContent" dir="rtl"> no result are fond! </div>');
      return;
  }
  else
  {
      $.ajax({
          url:'/includes/GetMtch.php',
          data:"Fdate="+Fdate,
          success: function(data){
              //alert(data);    // this is work 
              $("#bContent").html(data);   //but this line doesn't work.
          }
      })
  }
}
4

1 回答 1

1

你用的是什么版本的jquery?从 jquery 1.7 开始,live 已贬值:http: //api.jquery.com/live/

尝试使用“on”而不是 live: http ://api.jquery.com/on/

我同意charlietfl 的评论。这条线似乎有问题:

$(this).datepicker().datepicker('show');
于 2012-10-28T13:38:26.713 回答