weixin_33728708 2016-05-13 15:18 采纳率: 0%
浏览 39

ajax发送并返回mktime

Hello i m using an ajax function to get back the goog day from a script on my php file ... It' not working i don't understand why, please help i need ajax dont want to reload each time a date is picked in my php calendar

my HTML is

<p class="texte choixDate"></p>

so my jquery code is

$("#calendrier td a").click(function(){
var jour=$(this).text();
var mois="<?php echo $mois2;?>";
var annee="<?php echo $year;?>";
$.ajax({
url : 'requete.php',
type : 'GET',
data : 'jour='+jour+'&mois='+mois+'&annee='+annee,
dataType : 'text',
success : function(text){ // code_html contient le HTML renvoyé
       $(".texte.choixDate").empty();
       $(".texte.choixDate").append("<i class='fa fa-arrow-circle-down fa-2x'    aria-hidden='true'></i><br/>Vous avez choisi le " + text + " " + jour + " " + mois + " " + annee +"<br/><br/><a class='btn' href='accueil.php?val2=1#agenda1' title='Valider'>Valider</a>");
        }

    });

 });     

and my php file is

$semaine = array("Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"); 
$mois=$_GET["mois"];
$jour=$_GET["jour"];
$annee=$_GET["annee"];

$moisAtester2= mktime(0,0,0,$mois,$jour,$annee);

$jourSem=$semaine[date("w",$moisAtester2)];
echo $jourSem;

THANKS FOR HELP !!

  • 写回答

1条回答 默认 最新

  • weixin_33694620 2016-05-13 15:35
    关注

    just use the datetime picker where you can get do that

    onClose: function () {
            $scope.isSelected = true;
            var iMonth = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
            var iYear = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
            $(this).datepicker('setDate', new Date(iYear, iMonth, 1));
    
        }
    

    Use onClose function to call ajax

    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试