Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery ajax页面中的日期选择器不工作_Jquery_Ajax - Fatal编程技术网

Jquery ajax页面中的日期选择器不工作

Jquery ajax页面中的日期选择器不工作,jquery,ajax,Jquery,Ajax,我有两个页面main.php和ajx_receipt_sub_detail.php。1是th emain.php,另一个是用于加载datepicker页面ieajx_receipt_sub_detail.php的AJAX页面。但是datepicker工作不正常。但是当我尝试使用AJAX调用加载它时,选择器似乎根本不起作用。有人给出解决这些问题的方法吗 main.php function sub_detail(id) { var exchange_rate=$('#exchange_rate').

我有两个页面main.php和ajx_receipt_sub_detail.php。1是th emain.php,另一个是用于加载datepicker页面ieajx_receipt_sub_detail.php的AJAX页面。但是datepicker工作不正常。但是当我尝试使用AJAX调用加载它时,选择器似乎根本不起作用。有人给出解决这些问题的方法吗

main.php

function sub_detail(id)
{
var exchange_rate=$('#exchange_rate').val();
$.ajax({
    type: "POST",
    url: 'ajx_receipt_sub_detail.php',
    data:'id='+id + '&exchange_rate=' + exchange_rate,
    success: function(msg)
     { 
      $("#sub_detail").html(msg);

     }
  });   
}
ajx_收据_sub_detail.php

 <link rel="stylesheet" 
 href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
  <script>

  $(function() {
  $( "#slip_date2" ).datepicker({dateFormat:'yy-mm-dd'});
  });
  </script>
           <input name="slip_date" 
  style="width:81px;" type="text" class="txtfld"  id="slip_date2" value=""  />

$(函数(){
$(“#slip_date2”)。日期选择器({dateFormat:'yy-mm-dd'});
});

main.php中使用这个

    <link rel="stylesheet" 
     href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
     <script src="//code.jquery.com/jquery-1.10.2.js"></script>
     <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
      <script>
$(document).ready(function() {
     $("body").on("click", "#slip_date2", function(){
            if (!$(this).hasClass("hasDatepicker"))
            {
               $( "#slip_date2" ).datepicker({dateFormat:'yy-mm-dd'});
               $(this).datepicker("show");

            }
        });
 });
</script>

$(文档).ready(函数(){
$(“正文”)。在(“单击”,“滑动日期2”,函数()上{
if(!$(this).hasClass(“hasDatepicker”))
{
$(“#slip_date2”)。日期选择器({dateFormat:'yy-mm-dd'});
$(this.datepicker(“show”);
}
});
});