Hi,EveryOne
here is my code which return list of data from webmethod .this work succesfully on chrome,ff,and ie10,but what I can do for ie8/9 because it genrate 'acesss denied' error.I need potential solution for cross domain issue. I also have to pass data to a method like data: "{'countryMasterId':'" + CountryId + "'}".
so plz suggest your Idea.[what should I do for IE8/9?]
//
$.support.cors = true;
//FlightHotel Flyfrom
$.ajax({
type: "POST",
crossDomain: true,
url: "http://test.a1travel.com/WebMethods.aspx/GetFlightHotelSource",
datatype: "json",
//data: "{'countryMasterId':'" + CountryId + "'}",
contentType: "application/json; charset=utf-8",
success: function(result) {
FillFlightHotelSource(result.d);
},
error: function(XMLHttpRequest, status, errorThrown) {
alert(errorThrown);
}
});
function FillFlightHotelSource(result) {
var ddlFSource = document.getElementById("ddlFSource");
var ddlSource = document.getElementById("ddlSource");
if (result != null) {
for (var i = 0; i < result.length; i++) {
var option = document.createElement("option");
option.text = result[i].sName;
option.value = result[i].scode;
ddlFSource.options.add(option);
option = document.createElement("option");
option.text = result[i].sName;
option.value = result[i].scode;
ddlSource.options.add(option);
}
}
GetFHDestination(ddlSource);
GetFHDestination(ddlFSource);
}