title: JQuery populate select dropdown
body: <p>I am using Facebook Open Graph to retrieve information about the pages that I am admin with the following:</p>
  
  <pre><code>$user_profile_accounts = $facebook-&gt;api('/me/accounts','GET');
  foreach ($user_profile_accounts['data'] as $account) {
  ...
  }
  </code></pre>
  
  <p>After that I want to populate a select dropdown using <a href="http://www.marghoobsuleman.com/jquery-image-dropdown" rel="nofollow">jquery.dd</a> with the received informations. If I use it inside the foreach normally it will create a select like this:</p>
  
  <pre><code>&lt;select name="accmenu" id="accmenu"&gt;
      &lt;option data-description="&lt;?php echo $account['category'] ?&gt;" data-image="https://graph.facebook.com/&lt;?php echo $account['id']; ?&gt;/picture" value="&lt;?php echo $account['id'] ?&gt;"&gt;&lt;?php echo $account['name'] ?&gt;&lt;/options&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>for each of the account because is in the loop. This is not what I want, instead a dropdown with all the accounts is the desired outcome. If I put the select outside the foreach how I iterate through the data that I receive? Data:</p>
  
  <pre><code>{
    "data": [
      {
        "category": "Artist",
        "name": "Alexandra Dinu Official",
        "access_token": "BAAIGQYZBqjIABAPu8IEsuBqFVegB1ZCto61tvMIPVzUZC4JITosIHEr6dSHvYLsehcDYsCuBqlw13KepOsq1Eq1EDVqc0DFPm5sktlkjfZC8qoZAvQKyKxBdnVc2ihmBiu7nPYZC1oYznmcgm21iPCMrFTbO2OX6Vu5nSIZBvsaxTYWiyWISVixU0mTBmmi76DC8JV5FQRbZBzY7x2FRFsgQ5pZCrPStC06ZB3WhoSZBHZAZAMzs88norJYfH",
        "id": "116376655202954",
        "perms": [
          "ADMINISTER",
          "EDIT_PROFILE",
          "CREATE_CONTENT",
          "MODERATE_CONTENT",
          "CREATE_ADS",
          "BASIC_ADMIN"
        ]
      },
      {
        "category": "Fictional character",
        "name": "Potato Pete",
        "access_token": "BAAIGQYZBqjIABAKk4mM2jkVMk2miMjHkUWjZC75UDNnEPUZBNWz4ZBN3FqXbmKZAGSTyocAUzmehdIgUVSuRbr6rOg9Bq28rfsITrNT1kM7fcYFBfMA1yC9bG7c3JvaIZCgkQeXwVHx5pRJw1NFnCTOcFEmpAVlFOsAE2fy28k7zHpAky3wDQjsWD6KLEkqi0C44ZAhR3QQILCaFM9BwVn7Vpau2WUnbRHrZAjf4RofGUYEb9frEX3v1",
        "id": "497232410336701",
        "perms": [
          "ADMINISTER",
          "EDIT_PROFILE",
          "CREATE_CONTENT",
          "MODERATE_CONTENT",
          "CREATE_ADS",
          "BASIC_ADMIN"
        ]
      },
      {
        "category": "Event planning/event services",
        "name": "Mariage Fest",
        "access_token": "AAAIGQYZBqjIABAKqeomUfYZAkZAwINIZCiEBBUqw1DB6WM04090f5PrWNqzjX6SvF9Ld4l70ghwZAJYqAb2S587uQCm0cK1ZAaZABH1IDqUTlbOUZBD56EPxEnvYyEH1NM0ZD",
        "id": "311822035526927",
        "perms": [
          "ADMINISTER",
          "EDIT_PROFILE",
          "CREATE_CONTENT",
          "MODERATE_CONTENT",
          "CREATE_ADS",
          "BASIC_ADMIN"
        ]
      },
      {
        "category": "Restaurant/cafe",
        "name": "Pub Restaurant Wales Pitești",
        "access_token": "BAAIGQYZBqjIABAEYYZA4bvhnFnGEy2pfwUjDwuZA3ZBCDur4ItNJhcxh4uFeAatjO3zf4q6FioK1QyXWHTQTc4vQ5tPltCgrhXhN75TeGCY6ntONDwE0VHmBrTFXMZAsNmKZCx6QAfHWbsWADsNzOhtY7lhDznC9uH0dsfIzh2nQyZCQXZAAcoKGpnlArJjtud5iUxDqC3rlZA3N1xvXaeiwOH6CZCM8IySEZChZCRkP4C9NLeHzcuB4qlJV",
        "id": "252842318171796",
        "perms": [
          "ADMINISTER",
          "EDIT_PROFILE",
          "CREATE_CONTENT",
          "MODERATE_CONTENT",
          "CREATE_ADS",
          "BASIC_ADMIN"
        ]
      }
    ]
  }
  </code></pre>
  
  <p>It's a matter of PHP or JavaScript? I really appreciate any guidance. Thank you in advance. </p>