使用Ajax Json在SELECT中没有填充值。 [英] Values didn't populate in SELECT using Ajax Json.

查看:101
本文介绍了使用Ajax Json在SELECT中没有填充值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的专家,



我使用模板开发Asp.net应用程序。我在我的项目中使用了Ajax JSON。



现在我陷入填充下拉列表(HTML SELECT Control)。



我用ajax JSON来填充下拉列表中包含主题的数据...









Dear Experts,

i have used a template to develop an Asp.net application. And i have used Ajax JSON in my project.

And now i am stuck in populating the dropdownlist(HTML SELECT Control).

I am Used ajax JSON to populate the Datas in dropdownlist contains theme...




$.ajax(
                {
                    type: "POST",
                    url: "../../WebService.asmx/populate_Division",
                    dataType: "json",
                    data: JSON.stringify({ "Standard_ID": document.getElementById('ddl_Standard').value }),
                    contentType: "application/json; charset=utf-8",
                    success: function (json) {

                        var xmlDoc = "";
                        var xml = "";
                        xmlDoc = $.parseXML(json.d);
                        xml = $(xmlDoc);

                        document.getElementById("ddl_Division").innerHTML = "";
                       

                        $(xml).find("Table1").each(function () {
                            var Division_ID = $(this).find("Division_ID").text();
                            var Division = $(this).find("Division").text();
                          

                           $("#ddl_Division").append("<option value='" + Division_ID + "'>" + Division + "</option>");
                            
                          
                          
                        });
                       
                    }
                });















当我在下拉列表中使用主题时,数据不会被填充。但是当我删除该下拉列表的主题时,数据就会正确填充.....



jquery.chosen.js





我需要填充这个主题...



这里是下载示例项目的链接下载现在









请查看jsFiddle预览



jsFiddle Priview











注意:此示例项目是在HTML页面...请检查data.js文件









谢谢和问候,



Dileep

PLease帮我解决这个问题....








when i used the theme in dropdownlist then the datas are not populated. But when i remove the theme of that dropdownlist then the datas are populated properly.....

jquery.chosen.js


I need to populate with this theme...

HERE IS THE LINK TO DOWNLOAD THE SAMPLE PROJECT Download NOW


OR

PLease see the jsFiddle Preview

jsFiddle Priview





NOTE: This sample project is in HTML Pages... please check the data.js file




Thanks and Regards,

Dileep
PLease Help me to Solve this problem....

推荐答案

.ajax(
{
类型: POST
url: ../../ WebService.asmx / populate_Division
dataType: json
data: JSON .stringify({ Standard_ID document .getElementById(' ddl_Standard')。value}),
contentType: application / json; charset = utf-8
成功: function (json){

var xmlDoc = ;
var xml = ;
xmlDoc =
.ajax( { type: "POST", url: "../../WebService.asmx/populate_Division", dataType: "json", data: JSON.stringify({ "Standard_ID": document.getElementById('ddl_Standard').value }), contentType: "application/json; charset=utf-8", success: function (json) { var xmlDoc = ""; var xml = ""; xmlDoc =


.parseXML(json.d);
xml =
.parseXML(json.d); xml =


(xmlDoc);

document .getElementById( ddl_Division)。innerHTML = ;
(xmlDoc); document.getElementById("ddl_Division").innerHTML = "";


这篇关于使用Ajax Json在SELECT中没有填充值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆