我正在使用jQuery方法开发Country,State,City,但是问题是当load事件触发,也改变()被触发,并且我无法加载状态下拉关于加载事件,选择更改事件触发,jQuery
$("#SelectCountry").load() {
$.ajax({
url: "../Member/Home.aspx/GetCountryName",
type: "POST",
dataType: 'json',
contentType: 'application/json; charset=utf-8',
data: "{'name': '" + "1" + "'}",
async: false,
success: function (response) {
if (response.d != null) {
$.each(response.d, function (i, response) {
debugger;
$("#SelectCountry").append("<option value=" + response.CountryId + ">" + response.CountryName + "</option>");
});
}
},
error: function (xhr) {}
});
}
$("#SelectCountry").change() {
alert("Select event changed;");
}
如果你的代码格式正确,好的东西就会发生在你身上! :) – Trufa 2013-02-11 16:07:40