你能解释一下这个程序吗? [英] Can you explain this program
本文介绍了你能解释一下这个程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$.ajax({
type: "POST",
url: "NavigateLead.aspx/BindMake",
data: "{'year1':'" + year1 + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
//alert(msg);
var j = jQuery.parseJSON(msg.d);
//alert(msg.d);
var options = "";
for (var i = 0; i < j.length; i++) {
//alert(j[i].optionValue);
options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'
//alert(options);
}
$('#<%=drpMake.ClientID %>').html(options)
//$('.makebind').html(options);
},
error: function (data) {
// alert('Something Went Wrong')
}
});
我尝试过:
What I have tried:
$.ajax({
type: "POST",
url: "NavigateLead.aspx/BindMake",
data: "{'year1':'" + year1 + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
//alert(msg);
var j = jQuery.parseJSON(msg.d);
//alert(msg.d);
var options = "";
for (var i = 0; i < j.length; i++) {
//alert(j[i].optionValue);
options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'
//alert(options);
}
$('#<%=drpMake.ClientID %>').html(options)
//$('.makebind').html(options);
},
error: function (data) {
// alert('Something Went Wrong')
}
});
$.ajax({
type: "POST",
url: "NavigateLead.aspx/BindMake",
data: "{'year1':'" + year1 + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
//alert(msg);
var j = jQuery.parseJSON(msg.d);
//alert(msg.d);
var options = "";
for (var i = 0; i < j.length; i++) {
//alert(j[i].optionValue);
options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'
//alert(options);
}
$('#<%=drpMake.ClientID %>').html(options)
//$('.makebind').html(options);
},
error: function (data) {
// alert('Something Went Wrong')
}
});
推荐答案
.ajax({
类型: POST,
url: NavigateLead.aspx / BindMake,
data: {'year1':' + year1 + '},
contentType: application / json; charset = utf-8,
dataType: json,
成功: function (msg){
// alert(msg);
var j = jQuery.parseJSON(msg.d);
// alert(msg.d);
var options = ;
for ( var i = 0 ; i< j.length; i ++){
// alert(j [i] .optionValue);
options + = ' < option value =' + j [i] .optionValue + ' > + j [i] .optionDisplay + ' < /选项>'
// alert(options);
}
.ajax({ type: "POST", url: "NavigateLead.aspx/BindMake", data: "{'year1':'" + year1 + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { //alert(msg); var j = jQuery.parseJSON(msg.d); //alert(msg.d); var options = ""; for (var i = 0; i < j.length; i++) { //alert(j[i].optionValue); options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>' //alert(options); }
(' #<%= drpMake.ClientID%>' )。html(选项)
//
('#<%=drpMake.ClientID %>').html(options) //
('。makebind')。html(选项);
},
错误: function (数据){
// alert('Something Went Wurong')
}
} );
('.makebind').html(options); }, error: function (data) { // alert('Something Went Wrong') } });
我有什么试过:
What I have tried:
这篇关于你能解释一下这个程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文