Hi to all
Browser Compatibility Issue. Its working fine in IE 9 but it not working in mozilla and chrome. can anyone help me pls its very urgent. here it my code.
function onSelectedChanged() {
var countryId = $("#ddlCountry option:selected").val()
if (countryId != '') {
var url = 'http://192.168.0.60:4466/RestDataService/state?countryid=' + parseInt(countryId);
$.ajax({
url: url,
type: 'GET',
dataType: 'xml',
data: { countryid: countryId },
success: function (data) {
var select = $('#ddlState');
select.empty();
var count = data.getElementsByTagName("StateId");
select.append("<option value=1>Please the State</option>");
for (i = 0; i < count.length; i++) {
select.append("<option value='" + data.getElementsByTagName("StateId")[i].childNodes[0].nodeValue + "'>" + data.getElementsByTagName("StateName")[i].childNodes[0].nodeValue + "</option>");
}
},
error: function (xhr) {
alert(xhr.responseText);
},
complete: function () {
Rangineni
0 Points
19 Posts
Browser Compatibility Issue
May 04, 2012 05:21 AM|LINK
Hi to all
Browser Compatibility Issue. Its working fine in IE 9 but it not working in mozilla and chrome. can anyone help me pls its very urgent. here it my code.
function onSelectedChanged() {
var countryId = $("#ddlCountry option:selected").val()
if (countryId != '') {
var url = 'http://192.168.0.60:4466/RestDataService/state?countryid=' + parseInt(countryId);
$.ajax({
url: url,
type: 'GET',
dataType: 'xml',
data: { countryid: countryId },
success: function (data) {
var select = $('#ddlState');
select.empty();
var count = data.getElementsByTagName("StateId");
select.append("<option value=1>Please the State</option>");
for (i = 0; i < count.length; i++) {
select.append("<option value='" + data.getElementsByTagName("StateId")[i].childNodes[0].nodeValue + "'>" + data.getElementsByTagName("StateName")[i].childNodes[0].nodeValue + "</option>");
}
},
error: function (xhr) {
alert(xhr.responseText);
},
complete: function () {
}
});
}
else {
$('#ddlState').empty();
}
}
Thanks
Kumar
asteranup
All-Star
30184 Points
4906 Posts
Re: Browser Compatibility Issue
May 04, 2012 05:32 AM|LINK
Hi,
I suggest you to use JSON datatype-
http://delicious.com/anupdg/cascading
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog