Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);
}
});

C#
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);
}
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900