Skip to content

Instantly share code, notes, and snippets.

@joelpalmer
Created March 28, 2015 13:08
Show Gist options
  • Save joelpalmer/32a2c857c4dd55469753 to your computer and use it in GitHub Desktop.
Save joelpalmer/32a2c857c4dd55469753 to your computer and use it in GitHub Desktop.
AJAX loading for employee directory cloud app
$.ajax({
28 type: "GET",
29 url: "EDS/Company.xml",
30 dataType: "xml",
31 success: function (xml) {
32
33 var select = $('#companyDDL');
34
35 $(xml).find('Company').each(function () {
36
37 var name = $(this).find('Name').text();
38 select.append("<option>" + name + "</option>");
39
40 });
41
42 }
43 });
44
45 //$.ajax({
46 // type: "GET",
47 // url: "EDS/Department.xml",
48 // dataType: "xml",
49 // success: function (xml) {
50
51 // var select = $('#departmentDDL');
52
53 // $(xml).find('Department').each(function () {
54
55 // var name = $(this).find('Name').text();
56 // select.append("<option>" + name + "</option>");
57
58 // });
59
60 // }
61 //});
62
63 $.ajax({
64 type: "GET",
65 url: "EDS/Location.xml",
66 dataType: "xml",
67 success: function (xml) {
68
69 var select = $('#locationDDL');
70
71 $(xml).find('Location').each(function () {
72
73 var name = $(this).find('Name').text();
74 select.append("<option>" + name + "</option>");
75
76 });
77
78 }
79 });
80
81 $.ajax({
82 type: "GET",
83 url: "EDS/JobFamily.xml",
84 dataType: "xml",
85 success: function (xml) {
86
87 var select = $('#jobFamilyDDL');
88
89 $(xml).find('JobFamily').each(function () {
90
91 var name = $(this).find('Name').text();
92 select.append("<option>" + name + "</option>");
93
94 });
95
96 }
97 });
98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment