quelqu'un peut-il aider, j'ai un problème avec le mot-clé this .. avant d'entrer l'appel ajax est disponible mais en entrant Success. mon "ceci" est disponible mais ne contient pas la même information ie une méthode que je souhaite appeler .. Cet exemple montre ce que je veux dire ..Jquery "THIS" .myFuntionName est indisponible lorsque ajax succès? mais ok avant
J'apprécierais n'importe quelle aide, this.isoDateReviver est disponible avant de faire ajax. . puis quand le succès arives .. this.isoDateReiver est Undefined
var data = new Object();
data.year = this.today = new Date().getFullYear();
this.isoDateReviver("yes","yes"); //// THIS WORKS HERE
$.ajax({
type: "POST",
url: "MyService.aspx/GetHolidays",
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
var holidays = JSON.parse(msg.d,
this.isoDateReviver); // THIS DOES NOT WORK its undefined
Calendar.initalizeHolidays(holidays);
},
error: function(msg) {
alert(error);
}
});