Created
June 15, 2012 01:14
-
-
Save cluelesscoder/2934064 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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