Skip to content

Instantly share code, notes, and snippets.

@cluelesscoder
Created June 15, 2012 01:14
Show Gist options
  • Save cluelesscoder/2934064 to your computer and use it in GitHub Desktop.
Save cluelesscoder/2934064 to your computer and use it in GitHub Desktop.
// loadSectorOptions works but loadCountryOptions does not
function loadSectorOptions() {
$.getJSON(
"list-process.php",
"process=loadSectorOptions",
function(data) {
$.each(data.sectors, function(i, sector) {
var sectorOption = '<option value=\"'
+sector.sector_id+'\">'
+sector.sector_name+'</option>'
$(sectorOption).appendTo('select[name^="sector_options"]');
});
}
);
}
function loadCountryOptions() {
$.getJSON(
"list-process.php",
"process=loadCountryOptions",
function(data) {
$.each(data.countries, function(i, country) {
var countryOption = 'option value\"'
+country.country_id+'\">'
+country.country_name+'</option>'
$(countryOption).appendTo('select[name^="country_options"]');
});
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment