上拉列表绑定选种有关问题
下拉列表绑定选种问题
数据库读取数据后,通过AJAX 传到前台JS,下列表框绑定选种项,有时候绑定不到,不知道什么情况,代码如下
有时候绑定不到选种项,不知道什么问题高手帮忙.
------解决方案--------------------
动态页有问题吧。。
数据库读取数据后,通过AJAX 传到前台JS,下列表框绑定选种项,有时候绑定不到,不知道什么情况,代码如下
var option = {
type: "post",
url: "../xxx/xxx.aspx/selectbytid",
data: "{'tid':'" + cid + "'}",
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (response) {
var o = jQuery.parseJSON(response.d);
if (o != null) {
$("#type").attr("Value", o.TypeId);
$("#ptype").show();
var option = { type: "post",
url: "../xx/xxx.aspx/SelectType",
data: "{'pid':'" + o.TypeId + "'}",
contentType: "application/json;charset=utf-8",
dataType: "JSON",
success: function (response) {
var n = eval(response);
$("#ptype").append(n.d); //这里绑定选种项
$("#ptype").attr("Value", o.ptype);//这里绑定选种项
}
}
$.ajax(option);
有时候绑定不到选种项,不知道什么问题高手帮忙.
------解决方案--------------------
动态页有问题吧。。
var option = { type: "post",