I am trying to display all of the continents but all I am getting is '[object Object]' instead of the actual continent names. How can I actually get the continent names to show?
AJAX
<script>
$(document).ready(function(){
$.get('auto.php',{act:'fetchContinent'},loadContinents ,'json');
$("select#continents").change(function(){
$('div#display').html($("select#continents option:selected").text())});
function loadContinents(data){
var optionStr = "";
for (var index in data) {
optionStr += '<option value="' + data[index] + '">' + data[index] + '</option>\n';
}
$("select#continents").html(optionStr);}
});