Correctly parse a json array and update a select box

Ολοκληρωμένο Αναρτήθηκε Mar 29, 2014 Πληρώθηκε κατά την παράδοση
Ολοκληρωμένο Πληρώθηκε κατά την παράδοση

Need someone to provide a fix for this issue.

Have a jquery script which updates a select box with a list of ISO codes and countries.

The ajax response from the script is shown below.

[{"GBR":"United Kingdom"}]

Below is the actual script use to add this to the select box

[url removed, login to view](function( data ) {

$.each(data, function(index,value) {

$('#select3')

.append($("<option/>", {

value: index,

text: value

}))

.selectpicker('refresh');

});

});

This should result in result in an an option being added to the select of <option value='gbr'>United Kingdom

instead all I get is [object Object].

What I need is a fix which correct parses the array returned.

(Note that only one country is shown returned here, but it could be a may be 8 or nine different)

JavaScript jQuery / Prototype PHP

Ταυτότητα Εργασίας: #5735788

Σχετικά με την εργασία

13 προτάσεις Απομακρυσμένη εργασία Ενεργό Mar 29, 2014

Ανατέθηκε στον:

geomago

The correction is very simple, but you should tell me if , when the array contanis more countries it is done this way: [{"GBR":"United Kingdom"},{"ITA":"Italy"},{"USA":"United States"}] or this other way: [{"G Περισσότερα

$20 USD σε 0 μέρες
(5 Αξιολογήσεις)
3.6

13 freelancers κάνουν προσφορές κατά μέσο όρο $27 για αυτή τη δουλειά

acesolution

Hello Sir , I can do this now please provide me a chance to work for you ......................Thanks

$35 USD σε 1 μέρα
(128 Αξιολογήσεις)
6.7
roonex

Hi, can fix the code so it will show the right ISO code in the select box. Can you show me the site? Thanks

$29 USD σε 1 μέρα
(179 Αξιολογήσεις)
6.4
halezabux

Hi, I can do right now. Are you going to give the FTP or just the file so I can update it accordingly. Hope to work with you. Thanks

$35 USD σε 1 μέρα
(49 Αξιολογήσεις)
6.3
dustafo

I can get this done for you right away.

$50 USD σε 1 μέρα
(123 Αξιολογήσεις)
6.1
phpwebsoft

I would like to work on this project. I have 7 years of experience in open source technologies PHP/MySQL.

$34 USD σε 3 μέρες
(161 Αξιολογήσεις)
6.0
acer2004sl

Hello, I got it, it can be fixed within the next few hours. do u have FTP access? r u going to award that Regards ========================= ========================= =========================

$30 USD σε 0 μέρες
(177 Αξιολογήσεις)
6.0
anmoltech

Hello sir, I am a programmer with 4 years of work experiences. I'm familiar with html, html5, css, php, wordpress, cakephp, jQuery, javascript, ajax, mysql and yii framework. I am expert in jQuery. Please gi Περισσότερα

$24 USD σε 1 μέρα
(39 Αξιολογήσεις)
4.6
zendcoder

Hello This that you pose is something that won't take long to complete in deed, the fact that is not working for you tells me there is something else, maybe the data is not been returned correctly. I'll like to Περισσότερα

$15 USD σε 0 μέρες
(5 Αξιολογήσεις)
2.3
suronjit

I have 3 years experience in web developing using wordpress.I have sound knowledge in php, jquery, javascript,css and html. I am ready to do this task. Pls check my previous work and hire me sir.I have completed 40 wor Περισσότερα

$25 USD σε 1 μέρα
(3 Αξιολογήσεις)
1.8
killuwa

I am new freelancer here. But I have experiences before. so, let's discuss and I will do all my best for you. thanks.

$20 USD σε 1 μέρα
(0 Αξιολογήσεις)
0.0