Hi there,
can anyone help, i have an issue with the keyword this.. before entering the ajax call its available but when entering Success. my "this" is available but doesn't contain the same info i.e. a method i wish to call.. This example shows what i mean..
I would appreciate any help, this.isoDateReviver is available before doing ajax.. and then when success arives .. this.isoDateReiver is 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);
}
});