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

    评论

报告相同问题?