1
我有這樣的代碼JS:
$(document).on("click", "#nextMonth", function(e)
{
$.post(
'ajax/genererCalendrier.php',
{
"mois":mois, "annee":annee
},
function(data)
{
data = jQuery.parseJSON(data);
}).success(function()
{
$('#divCalendrier').html(calendrier);
$.ajax(
{
url: 'ajax/genererCalendrier.php',
type: 'POST',
data:
{
'action':'rafraichir_nombre_jours_conges'
},
dataType:'text',
success: function(retour_php)
{
alert(retour_php);
},
error: function()
{
alert("pas ok");
}
});
}).error(function()
{
$('#divCalendrier').html('<p class="error">Erreur lors de la requête AJAX</p>');
});
});
此警報不啓動:
alert(retour_php);
是我的代碼($就到$。員額)是正確的?
我沒有螢火蟲的錯誤。
檢查錯誤控制檯,如果你得到任何錯誤消息。 – Guffa 2015-04-05 13:38:45
我在控制檯中沒有錯誤。 – beegees 2015-04-05 13:39:59
請使用正確的縮進並重新檢查您的代碼。我沒有看到'$(document).ready(function(){..' – 2015-04-05 13:46:35